Hi,
suppose i have syntax like this:
Dim cn As New SqlConnection(ConString)
Dim cmd As New SqlCommand("select * from emp", cn)
Dim dr As SqlDataReader
cn.Open()
dr = cmd.ExecuteReader
suppose that the table emp have 500 record. now i just want to view record number 320. how am i do this? i usually do this:
if dr.hasrows then
dim i as integer=0
while dr.read
i += 1
if i = 320 then
txtname.text=dr.item("name")
txtaddress.text=dr.item("address")
end if
end while
end if
is there any efective way to do this? please help. thanks
yugi
suppose i have syntax like this:
Dim cn As New SqlConnection(ConString)
Dim cmd As New SqlCommand("select * from emp", cn)
Dim dr As SqlDataReader
cn.Open()
dr = cmd.ExecuteReader
suppose that the table emp have 500 record. now i just want to view record number 320. how am i do this? i usually do this:
if dr.hasrows then
dim i as integer=0
while dr.read
i += 1
if i = 320 then
txtname.text=dr.item("name")
txtaddress.text=dr.item("address")
end if
end while
end if
is there any efective way to do this? please help. thanks
yugi