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 special types forms
Explain the difference between asp.net mvc and asp.net webforms
Where is session cookies stored?
What is application Object?
How to implement form based authentication in asp.net application?
Can we have multiple web config files for an asp.net application?
Explain about the .NET framework?
What does session_start () do?
Describe state management in asp.net?
how to debug web services on consumer side?
What are client activated objects?
How do I open an ashx file?
What do you mean by role-based security?
benefits of migration from asp to asp.net hi frnds, i have to give presentation to a client about how useful would be migrating their project from asp to asp.net .plz give me some points which i should incorporate in my ppt thanks
What is view state and how it works in asp net?