Nate Bross Posted August 30, 2006 Posted August 30, 2006 I just wanna know if there is a better way to get a recordset into a dataset... This code works, just wondering if there is something 'better' Dim rsDB2Data as RecordSet sSQL = "Select * from " & sDB2Qual & ".SH_QUOTE" Dim ds As New DataSet rsDB2Data = AdoDB2Conn.Execute(sSQL) Dim oleda As New OleDb.OleDbDataAdapter oleda.Fill(ds, rsDB2Data, sDB2Qual & ".SH_QUOTE") Additionally, is it normal to have my AdoDB.dll in C:\Program Files\Microsoft.NET\Primary Interop Assemblies\ADODB.dll I want to be using ADO.NET, but since it's in Interop folder it makes me worried I am using the old COM version. -Thanks Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
Administrators PlausiblyDamp Posted August 30, 2006 Administrators Posted August 30, 2006 Recordsets are ADO not ADO.Net, the .DLL in the interop folder is a wrapper around the COM ADODB.DLL component. If you are running the code yourself then you could just use the classes under System.Data.OleDb directly (OleDbConnection, OleDbCommand etc.). Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Nate Bross Posted August 30, 2006 Author Posted August 30, 2006 So I am calling ADO.NET? And there is not a better way using ADO.NET? Due to project constraints, I cannot use OleDb, as the DB/2 Drivers are not installed. Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
Administrators PlausiblyDamp Posted August 30, 2006 Administrators Posted August 30, 2006 In you sample the code refering to OleDbDataAdapter and DataSet is ADO.Net code, the Recordset however is just plain old ADO cide. If you do not have the OleDb drivers for DB2 installed how are you getting the data into an ADODB Recordset? Your code snippet makes it look as though you have them installed as you are using an ADO Connection to execute the SELECT statement. Alternatively you could use the classes under System.Data.Odbc if you havea DB2 odbc driver installed. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Nate Bross Posted August 31, 2006 Author Posted August 31, 2006 I used System.Data.ODBC like you said, and it worked great! Thanks for the help. Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
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.