retrieving data from backend in vb.net

srivalli

Well-known member
Joined
May 4, 2005
Messages
189
Programming Experience
Beginner
hello
good afternoon
i want to retrieve the data from the back end in vb.net. ie.
my requirement is i want to enter some field say id column of a particular table and i want the corresponding id details in the remaining textboxes.

for ex,
in my table i have 3 columns
say
name,id and city
i placed three textboxes in the form.
in one textbox i ll enter the id.
i want to display that id details in the remaining two textboxes from the back end.
thank u
bye
 
enter the ID value in textID and click i.e. button (you could choose another control for trigger)

Join this to the button:

VB.NET:
establish connection, and declare reader and command
{...}
Dim strSQL As String ="SELECT * FROM table WHERE id=" & textID.text & ""
cmd = new oledbcommand(strSQL, connection)
reader = cmd.executeReader
While reader.read 
txtName.Text = reader("name") & ""
txtCity.Text = reader("city") & ""
End read
reader.close()
{...}

Cheers ;)
 
Back
Top