C# and ADO RecordSet

G

Gilgamesh

How do I pass a result of a stored procedure from a C# assembly to a VB 6 so
VB can see the result as RecordSet?

Thanks,
Gilgamesh
 
N

Nicholas Paldino [.NET/C# MVP]

Gilgamesh,

The best way to do it would be to access the data through ADO (not
ADO.NET) through COM interop in .NET, and then pass the recordset along to
VB.
 
M

Marc Gravell

Of course, you could also serialize to disk as csv and read from
there... depending on the data volume it might be quicker (less
interop). Of course, then you just need to get the export and import
working...

Perhaps the VB6 could just run the stored procedure itself? ;-p

Marc
 
M

Marc Gravell

d'oh! yes - exec the proc in legacy ADO via C#. I feel so dirty
touching ADO with C# that it didn't even occur. Good catch.
 
G

Gilgamesh

That's what I'm doing. Thanks for your help.
-G


Nicholas Paldino said:
Gilgamesh,

The best way to do it would be to access the data through ADO (not
ADO.NET) through COM interop in .NET, and then pass the recordset along to
VB.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Gilgamesh said:
How do I pass a result of a stored procedure from a C# assembly to a VB 6
so VB can see the result as RecordSet?

Thanks,
Gilgamesh
 
G

Gilgamesh

I'm using the following code to run a stored procedure which doesn't need a
parameter:

Recordset _recordSet = _adoCommand.Execute(out _dummy1, ref _dummy2,
(int)ExecuteOptionEnum.adExecuteRecord);

The above code throws this error: Parameter object is improperly defined.
Inconsistent or incomplete information was provided. at
ADODB.CommandClass.Execute(Object& RecordsAffected, Object& Parameters,
Int32 Options)

Any idea why the command object doesn't understand that no parameters are
needed?

-G

Nicholas Paldino said:
Gilgamesh,

The best way to do it would be to access the data through ADO (not
ADO.NET) through COM interop in .NET, and then pass the recordset along to
VB.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Gilgamesh said:
How do I pass a result of a stored procedure from a C# assembly to a VB 6
so VB can see the result as RecordSet?

Thanks,
Gilgamesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top