PC Review


Reply
Thread Tools Rate Thread

Convert _Recordset to DataSet/DataTable

 
 
B. Salmon
Guest
Posts: n/a
 
      24th Jun 2005
I have a Visual C++ .NET function that is calling an unmanaged function that
returns an ADO _Recordset* object. I want to be able to convert that into
an ADO.NET DataSet (or DataTable). I tried to use the OleDbDataAdapter.Fill
method, but I could only get that to work if I gave it an
ADODB::RecordsetClass object. I couldn't figure out how to get an ADO
_Recordset into an ADODB::RecordsetClass.

Any ideas? I don't want to have to rewrite all of our existing unmanaged
code.

- Brad


 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      25th Jun 2005
B. Salmon,

There is an overloaded fill to make from a recordset a dataset. Be aware
that AFAIK this is all you can do with it.

http://msdn.microsoft.com/library/de...filltopic1.asp

I hope this helps,

Cor


 
Reply With Quote
 
B. Salmon
Guest
Posts: n/a
 
      27th Jun 2005
Cor,
Thanks, but I have already looked at that approach. The problem with that
Fill method is that the method takes a "managed" Recordset. In other words,
I need to add a reference to the ADO COM component so a interop wrapper is
created, ADODB. I can then pass an ADODB::RecordsetClass object into the
Fill. My problem is that I'm in C++ and want to call a method in an
existing library that knows nothing about .Net and is returning a
_Recordset* object. In that case, I haven't figured out a way to make the
_Recordset* object become an ADODB::RecordsetClass object so I can call the
Fill method you refer to.

- Brad

"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> B. Salmon,
>
> There is an overloaded fill to make from a recordset a dataset. Be aware
> that AFAIK this is all you can do with it.
>
> http://msdn.microsoft.com/library/de...filltopic1.asp
>
> I hope this helps,
>
> Cor
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      27th Jun 2005
Brad,

Sorry I would not know how to solve your problem, this was all I knowed.
However maybe the dotnet data newsgroup is an alternative when you get no
further answer here..

That newsgroup is in my opinion more dedicated to the recordset.

Creating a DataTable or Dataset is of course a piece of case.

Cor


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I convert IList to a DataSet, DataTable or DataView? =?Utf-8?B?Tmljaw==?= Microsoft ASP .NET 6 19th Jul 2006 07:39 PM
How convert Excel data into DataSet/DataTable? Ronald S. Cook Microsoft C# .NET 2 14th Feb 2006 09:30 PM
Convert _Recordset to DataSet/DataTable B. Salmon Microsoft VC .NET 5 28th Jun 2005 04:16 AM
convert untyped datatable/dataset into strongly typed Somebody_Out_There Microsoft ADO .NET 2 15th May 2004 12:12 AM
convert untyped datatable/dataset into strongly typed Somebody_Out_There Microsoft C# .NET 1 14th May 2004 09:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:34 AM.