Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hey guys and gals. First post on dotnettalk forums but I've been on your sister site vbtalk. So, hey there!

 

I have some general questions about ADO .NET. I've done some reading on MSDN and such and I'm still a little foggy.

 

I'm 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 don't see this listed as a data provider. Therefore I'm 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!

  • Administrators
Posted

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 isn't really using the .Net libraries though and many of the data binding features in .Net aren't 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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...