What is the equivalent to Recordset.Properties() collection inADO.NET

  • Thread starter Thread starter tchnologist
  • Start date Start date
T

tchnologist

I am trying to convert some VB6 ADO code to ADO.NET and have a
problem. The existing code sets system properties on the OLE DB data
provider in the RecordSet.Properties() collection prior to opening the
RecordSet. Example:

rsDocs.Properties("SupportsObjSet") = True

However, I don't see any equivalent to this in any ADO.NET class.
Does anyone know how to do something like this in .NET?
 
Ah, comparing COM-based ADO (ADOc) with ADO.NET is tough. They are built
very differently--so are the data access providers. While some of the
classes have similar spellings and some apparently common functions, how
they are implemented is very different.
ADOc is basically an interface to OLE DB. ADO.NET is a lower-level interface
that permits you to choose a specific data access provider that communicates
with the DBMS through it's native interface like TDS for SQL Server or
PL/SQL for Oracle. It also supports what I call "OSFA" (one-size-fits-all)
interfaces like the OleDb and Odbc namespaces as supported by the .NET
Framework. When working with a backend database you really need to use the
..NET data provider that's designed for your DBMS--avoiding the OleDb
approach whenever possible.

Question, can you manipulate the OleDb provider by setting properties in
ADO.NET as you have shown? No, this is not possible--this functionality is
not supported AFAIK. Is the equivalent functionality available through some
other means? It would help to know what you are trying to accomplish by
setting this property besides trying to convert an ADOc application to
ADO.NET. As I discuss in my book "ADO and ADO.NET Examples and Best
Practices", it is a waste of time to attempt a 1:1 conversion--there are too
many disconnects. As I said, ADOc and ADO.NET are very different in so many
ways. Most developers that have successfully converted VB6 applications to
VB.NET or some other .NET language have converted the functionality using
21st century technology and have abandoned trying to get the old ways to
work with .NET.


--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
 
Hi,

Try it with Linq to SQL, the concept around the Datacontext is in my opinion
much more look alike to the old recordset then the datatable. The main
difference is that you have to submit the changes, while the recordset is
connect so that is done automaticly.

Cor
 
Back
Top