How do I autodecrement the number of students allowed everytime you assign a section to each student added?
I have the code, but it has an error.
private void btnAssign_Click(object sender, EventArgs e)
{
////for auto increment
ds = DBConn.getStudentDetails("sp_Retrieve_Student_Section");
int cnt = ds.Tables[0].Rows.Count;
string lastrec = ds.Tables[0].Rows[cnt+1][1].ToString();
int newpcode = int.Parse(lastrec) - 1;
txtAllowed.Text= newpcode.ToString();
}