ADO .NET for both SQL Server and Oracle

wsuBobby

New member
Joined
Jul 21, 2009
Messages
4
Hey guys and gals. First post on dotnettalk forums but Ive been on your sister site vbtalk. So, hey there!

I have some general questions about ADO .NET. Ive done some reading on MSDN and such and Im still a little foggy.

Im porting some db access code from VB6 to .NET. In VB6 I used ADO 2.5 reference (Microsoft ActiveX Data Objects 2.5 Library). Now, when porting to .NET code, I am not referencing this VB6 reference. Instead I am using the Imports ADODB statement.

1st question: Using the Imports ADODB statment, is this considered ADO .NET?

When reading about ADO .NET I dont see this listed as a data provider. Therefore Im confused if Imports ADODB is ADO .NET.

2nd question: Using the Imports ADODB statment in .NET allows my connection strings for both SQL Server and Oracle to connect correctly. If Imports ADODB is not ADO .NET then what is an option that allow connectivity for both SQL Server and Oracle?

Thanks in advance!
 
ADODB is still using the ActiveX Data Objects rather than the ADO.Net providers, this means you will still be using the same classes (Recordsets etc.) that you were using in VB6.

This isnt really using the .Net libraries though and many of the data binding features in .Net arent designed to work with the older COM based methods.

The actual ADO.Net providers are found under the System.Data namespace (e.g. Sql is SYstem.Data.SqlClient)

Regarding the 2nd question you have a couple of options - you could always use the OleDb providers (System.Data.OleDb) or alternatively you could write your code based around the underlying interfaces (IdbConnection, IdbCommand etc) and generate the correct type at runtime - if this seems a likely option then I can dig up some sample code.

Depending on the version of .Net you may also want to investigate the Entity Framework as another option.
 
Alright.

Thanks for the info.

I was pretty sure that ADODB wasnt what I was looking for. My final solution uses OLEDB and works like a champ.
 
Back
Top