How to check the end of the record in Datareader?
Answer Posted / bhagwat prasad sharma
{vb.net code for selection by data reader}
//\\Start......
imports system.data.sqlclients
public class
dim con as new sqlconnection("server=bps; database=college; user id=sa; password=admin")
private button1 ()
dim str as string="select
name from student where roll_no=1"
dim cmd as new sqlcommand(str,con)
if con.state=connectionstate.closed than
con.open()
cmd.parameters.add("@roll_no",type.int)
cmd.parameters("@roll_no").value=txtroll.text
dim dr as sqldatareader
dr=cmd.executereader
if dr.read than
txtname.text=dr(1)
else
msgbox("selection error ")
end if
con.close()
end sub
end class
| Is This Answer Correct ? | 4 Yes | 4 No |
Post New Answer View All Answers
What is the difference between runtime version and version?
What is the used of "ispostback" property?
How long do session variables last?
Mention few asp.net validators.
What is skin in asp.net?
What is server side session?
What are tuples?
Can we override the enablepartialrendering property of the scriptmanager class?
How many types of validators are there in asp net?
Can more than one person use the same login?
Name some asp objects?
I’m having some trouble with cas. How can I diagnose my problem?
while developing webservices if i want some users to use my webservice only how can i give security to my webservice?
What is session id in web application?
How do I debug an asp.net application that was not written with visual studio.net and that does not use code-behind?