Re: Proxy between VB6 ADO and ADO.Net
From: William \(Bill\) Vaughn (billvaRemoveThis_at_nwlink.com)
Date: 03/22/04
- Previous message: Marcelo Marchesoni: "query with parameters and asp"
- In reply to: Holt: "Proxy between VB6 ADO and ADO.Net"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 22 Mar 2004 14:44:14 -0800
It's easy to go from the OLE DB ADO Recordset to a .NET DataSet.
The OleDb .NET Data Provider exposes the Fill method with an overload that
can take a Recordset as an input parameter.
myDataAdapter.Fill(myDataSet, myRecordset)
Going in the other direction is a lot harder but possible. I discuss this in
my session this week at VSLive in SFO.
hth
Online help shows:
Dim custDA As OleDbDataAdapter = New OleDbDataAdapter()
Dim custDS As DataSet = New DataSet
'Use ADO objects from ADO library (msado15.dll) imported
' as .NET library ADODB.dll using TlbImp.exe
Dim adoConn As ADODB.Connection = New ADODB.Connection()
Dim adoRS As ADODB.Recordset = New ADODB.Recordset()
adoConn.Open("Provider=SQLOLEDB;Data Source=localhost;Initial
Catalog=Northwind;Integrated Security=SSPI;", "", "", -1)
adoRS.Open("SELECT * FROM Customers", adoConn,
ADODB.CursorTypeEnum.adOpenForwardOnly, ADODB.LockTypeEnum.adLockReadOnly,
1)
custDA.Fill(custDS, adoRS, "Customers")
adoConn.Close()
.
-- ____________________________________ William (Bill) Vaughn Author, Mentor, Consultant Microsoft MVP www.betav.com Please reply only to the newsgroup so that others can benefit. This posting is provided "AS IS" with no warranties, and confers no rights. __________________________________ "Holt" <anonymous@discussions.microsoft.com> wrote in message news:8FDEDA5B-EDA1-475B-A607-7FB5FAE7F2C8@microsoft.com... > I have an n-tier application that was built in VB6 and uses the old ADO recordsets to pass data between layers. I would like to rewrite part of the application, but cannot afford to rewrite it all. Has anyone built a proxy class for taking a recordset and transforming it into a dataset?
- Previous message: Marcelo Marchesoni: "query with parameters and asp"
- In reply to: Holt: "Proxy between VB6 ADO and ADO.Net"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|