Hai, i am clicking a button 'findnext' and calling the event btnclick on its onclick event.I want to display the records in my form fields one by one.
The following code displays only the first record of the datareader in my fields.
I want to display my next record when i click the button findnext.
How do i display my second record of the datareader??
anybody pls help.
tx
sub btnclick(sender as object,e as eventargs)
Dim mydr1 As SqlDataReader
sql1 = "SELECT * FROM Nt_site_contact WHERE " & _
"first_name = '" & s & "'"
'connections goes here
mydr1 = mycmd1.ExecuteReader()
mydr1.read()
While mydr1.Read()
pp_last.text =mydr1("last_name")
pp_address1.text=mydr1("Address1")
End While
mydr1.Close()
mycon1.Close()
end sub.
The following code displays only the first record of the datareader in my fields.
I want to display my next record when i click the button findnext.
How do i display my second record of the datareader??
anybody pls help.
tx
sub btnclick(sender as object,e as eventargs)
Dim mydr1 As SqlDataReader
sql1 = "SELECT * FROM Nt_site_contact WHERE " & _
"first_name = '" & s & "'"
'connections goes here
mydr1 = mycmd1.ExecuteReader()
mydr1.read()
While mydr1.Read()
pp_last.text =mydr1("last_name")
pp_address1.text=mydr1("Address1")
End While
mydr1.Close()
mycon1.Close()
end sub.