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 sealed vs static class?
How can we inherit a static variable?
What do you mean by View State and what is its role?
What is an assembly? Explain its parts.
Why we are using mvc instead of asp.net? : Asp.Net MVC
What are the different validators in asp.net?
Can you explain one critical mapping? Performance issue which one is better?
1.can we add connection string in global.asax?????????? 2.what are the default files included when we create new web application????
What is ViewState? What does the "EnableViewState" property do? Why would I want it on or off?
Do you support digital rights management to protect my videos?
Define satellite assemblies.
Can you explain architecture of your project ?
Using code explain Configuration Management
What is meant by asp.net?
How many types of Cookies are available in ASP.NET?