wsuBobby Posted July 21, 2009 Posted July 21, 2009 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! Quote
Administrators PlausiblyDamp Posted July 21, 2009 Administrators Posted July 21, 2009 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
wsuBobby Posted July 27, 2009 Author Posted July 27, 2009 Alright. Thanks for the info. I was pretty sure that ADODB wasn't what I was looking for. My final solution uses OLEDB and works like a champ. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.