Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to check the end of the record in Datareader?

Answers were Sorted based on User's Feedback



How to check the end of the record in Datareader?..

Answer / anitha

Dim cmdstr As String
Dim cmdsql As New SqlClient.SqlCommand
Dim consql As SqlConnection = New
SqlConnection(ConfigurationSettings.AppSettings("ConnectionString"))
cmdstr = "select top 1 columnName from tbl_Sample order by
ColumnName desc "
cmdsql = New SqlCommand(cmdstr, consql)
If consql.State = ConnectionState.Closed Then
consql.Open()
Dim drsql As SqlDataReader
drsql = cmdsql.ExecuteReader()
Do While drsql.Read
any Control value= drsql.Item(0)
Loop
drsql.Close()

Is This Answer Correct ?    8 Yes 1 No

How to check the end of the record in Datareader?..

Answer / 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

More ASP.NET Interview Questions

can we store textbox and com components in viewstate?

4 Answers   Microsoft,


How to create events for a control?

0 Answers  


What does asp in asp.net stand for?

0 Answers  


What is marshalling ? Is it a part of asp.net ?

0 Answers   MCN Solutions,


What is client side state management?

0 Answers  


What parameters can you pass in the url of the api? Can get and post use the same url?

0 Answers  


Explain the difference between Repeater and Data list control in ASP.NET?

0 Answers  


If i have 1000 records in dataset, how to do paging?

2 Answers   Mind Tree,


How to add DateTime Control in normal DataGrid Server Control?

0 Answers  


What are the session management techniques asp net?

0 Answers  


How do you do exception management

1 Answers   Infosys,


Explain the Order of events in an asp.net page?

0 Answers  


Categories