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 latest version of asp.net?
What is the use of the tag in the web.config file?
Is asp.net free?
What is difference between ispostback and autopostback in asp net?
Why do we need master page in asp.net?
What is the difference between response.redirect and server.transfer?
What is asp.net and ado net?
Name the two properties are on every validation control?
What is a postback url?
What is the namespace to create thread in .net?
Explain significance of routing? : asp.net mvc
What is a 401 redirect?
Is it possible for me to change my aspx file extension to some other name?
What are the uses of list view control in Asp.net?
How ASP and ASP.NET page works? Explain about asp.net page life cycle?