cmd.CommandText = "Select IsNull(Max(SRN)) from Employee" cmd.Connection = con rd = cmd.ExecuteReader(CommandBehavior.CloseConnection) If (rd.HasRows) Then rd.Read() str = Convert.ToInt32(rd(0)) str = str + 1 txtSRN.Text = str Else txtSRN.Text = "1" End If
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)