C# and ADO RecordSet

  • Thread starter Thread starter Gilgamesh
  • Start date Start date
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
 
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.
 
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
 
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.
 
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
 
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
 
Back
Top