Click here to Skip to main content
15,888,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I just want to ask about my problem in my vb.NET project since I was before using ADODB(from my past experience on vb6).

I'm just NEW on using SQLClient namespace on vb.NET and find out that it works or fits on my project perfectly.

My question is this,

"Is there any way or a code using SQL command property or anything, that will function just the same as "rs.EOF" from my previous project that was using ADODB(Recordset/rs)? Is there also a property of SQLCommand that will functioned the same as ".EOF" property of recordset?"

Thanks for who might help me.

What I have tried:

VB
If Not rs.EOF Then
  If Not rs = DBNull.Value Then
  'DateReceived = rs![Date]
   xlApp.Sheets("Sheet1").Cells(RPos, "D").NumberFormat = "mm/dd/yy"
   xlApp.Sheets("Sheet1").Cells(RPos, "D").Value = DateReceived
  End If
End If

~ rs codes were from my previous project that was using adodb namespace, I'm now using sqlclient namespace so I need to convert these codes to work for my new namespace.
Posted
Updated 28-Jul-16 20:00pm
v2

1 solution

Here in VB.NET to fetch record from database you can use either use DataReader or Dataset, You can use the ADO.NET DataReader to retrieve a read-only, forward-only stream of data from a database
see below MSDN links for it
Retrieving Data Using a DataReader[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900