Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

  • Administrators
Posted

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.).

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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.

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

  • Administrators
Posted

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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
I used System.Data.ODBC like you said, and it worked great! Thanks for the help.

~Nate�

___________________________________________

Please use the [vb]/[cs] tags on posted code.

Please post solutions you find somewhere else.

Follow me on Twitter here.

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...