Sub auto()
c.con.Open()
Dim j As Integer = 0
Dim cmd As New SqlCommand("select staffid from staff order by staffid", c.con)
Dim dr As SqlDataReader()
dr = cmd.ExecuteReader()
While (dr.read())
txtstaff_id.Text = dr("staffid").ToString()
End While
j = Convert.ToInt32("txtstaff_id.text").ToString()
j = j + 1
txtstaff_id.Text = j.ToString()
dr.close()
c.con.Close()
End Sub
i have created this method but error occured...
i want to create method for auto_generate_id()
what is the wrong in this coding
please help me, it's urgent