dear Sir,

I have tried to populate the textbox from auto generate serial no column of sql server 2005 with this code below, but it does not work, the textbox still show empty.
So kindly help me how to display the textbox with the data retrieve from sql server 2005


Public Sub serialnogenerate()
connect()
sqlquery = "select c_slno from newconnection"
cmd = New SqlCommand(sqlquery, con)
dr = cmd.ExecuteReader
While dr.Read
a = dr(0)
End While
serialnotxt.Text = a + 1
con.Close()
End Sub