Add System.Data.DataSet to Visio DataRecordSets Collection

W

Woof

I'm assuming I can convert / cast a standard DataSet (ASP.NET C#) so that I
can use it as a Visio DataRecordSet?

Unfortunately I can't find the right way to achieve this without possibly
adding all the columns, rows and keys manually.

Is there a simple way to do this? My DataSet construction is too complicated
to add a SQL SELECT statement and use the DataRecordSets.Add method.

Thanks in advance.
 
A

Al Edlund

assumptions can be dangerous things. you have to do the work of moving a
datatable (not dataset) to the recordsets. I found I had to do something
like this ...
The conversion routines are in the v2007 sdk on msdn.

hope this helps,

al


Dim adoClassicXML As String

' call the conversion function.

adoClassicXML = _

ConvertToAdoRecordsetXML(myDataTable)

' create a new recordset using ADOclassicXML

myDocument.DataRecordsets.AddFromXML( _

adoClassicXML, _

0, _

"DataTableName")
 
W

Woof

Thanks Al, that did the job.

Al Edlund said:
assumptions can be dangerous things. you have to do the work of moving a
datatable (not dataset) to the recordsets. I found I had to do something
like this ...
The conversion routines are in the v2007 sdk on msdn.

hope this helps,

al


Dim adoClassicXML As String

' call the conversion function.

adoClassicXML = _

ConvertToAdoRecordsetXML(myDataTable)

' create a new recordset using ADOclassicXML

myDocument.DataRecordsets.AddFromXML( _

adoClassicXML, _

0, _

"DataTableName")
 

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

Top