Hello to all,
I want to auto generate id that should be access from my sql database.
I try this code-
Dim j As Integer = 0
Dim cmd As New SqlCommand("select staff_id from staff ", c.con)
Dim dr As SqlDataReader
dr = cmd.ExecuteReader()
While (dr.Read())
txtstaff_id.Text = dr("staff_id").ToString()
j = Convert.ToInt32("txtstaff_id.text".ToString())
j = j + 1
txtstaff_id.Text = j.ToString()
End While
dr.Close()
error occurs in
j = Convert.ToInt32("txtstaff_id.text".ToString())
please check, Is this in right format?
please reply soon, i have to submit my project on monday.