Transfer ADO Code to ADO.NET

R

ronaldlee

HI,
how to do a RecordSet in OleDbConnection???
my original code is using ADODB.RecordSet
But how can i do the RecordSet in OleDbConnection?

my original code

Function openDB() As Object
objConn = New ADODB.Connection
objConn.Open(dbDNS) '("dbfile")

objRS = New ADODB.Recordset

End Function


Function closeDB() As Object
' If the RecordSet has a state of 1 (open) close it
If objRS.state = 1 Then
objRS.Close()
End If

objConn.Close()
objConn = Nothing
End Function

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
 
K

Kevin Spencer

This is really a bad way to do database operations in ASP.Net. Interop is
problematic, and there are plenty of classes in the CLR for working with
databases. I would suggest using them.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top