470,591 Members | 2,005 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,591 developers. It's quick & easy.

Searching multiple records

2
Hi guys. I need ur help.
In VB.NET we usually use this code to search the database through windows application:
CODE::::::
private sub btnSearch_click(--)
dim empno as byte
empno=inputbox("Enter emp no")
dim r as datarow
r=ds.tables("emp").rows.find(a)
if r is nothing then
Msgbox("Emp not found")
else
t1.twxt=r.items(0)
t2.text=r.items(1)
end if
end sub

By this we can get one emp info. but If i wnt to search another emp's info by providing empno second time, then the first fetched record will be cleared and will get new searched record in the textboxes.

Qns is: I wnt the multiple records should display, so plz tell me how to do that with detail descriptions.
And also if possible plz tell me the same concept in C#.NET with detailed coding.

Waiting for the reply. Thanks in Advance.
Mash.
Mar 25 '07 #1
1 979
kenobewan
4,871 Expert 4TB
Welcome to the site. Data readers are forward and read only. If you want to display multiple records, then you will need to loop through them. Otherwise you may choose to use another object like a dataset. HTH.
Mar 25 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Robert Oschler | last post: by
33 posts views Thread by Geoff Jones | last post: by
1 post views Thread by BlackJackal | last post: by
reply views Thread by qudra | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.