Exporting XML Schema

J

Jeremy Ames

I know there is a way to do this as I have done it before with Crystal Reports tech support on the phone. I (mistakenly) have misplaced that code. What I need to do is convert a dataset into an XML schema file that I can use to generate another Crystal Report.

Thanks in advance for any help that you can give me.
 
J

Jeremy Ames

Nevermind, I got it working. Here is what I came up with for anyone else
that was curious:

Dim rsData As ADODB.Recordset, sSql As String
Dim myDataAdapter As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter
Dim myDataSet As DataSet = New DataSet

rsData = New ADODB.Recordset

sSql = "SELECT someData FROM someTable"

rsData.Open(sSql, frmPrizeBooth.gcnPrizeBooth, _
ADODB.CursorTypeEnum.adOpenForwardOnly, _
ADODB.LockTypeEnum.adLockReadOnly)

myDataAdapter.Fill(myDataSet, rsData, "My Table")

Dim sFileName As String = "Customer.xsd"
Dim oFileStream As System.New IO.FileStream(sFileName,
System.IO.FileMode.Create)

myDataSet.WriteXmlSchema(oFileStream)

rsData.Close()


I know there is a way to do this as I have done it before with Crystal
Reports tech support on the phone. I (mistakenly) have misplaced that code.
What I need to do is convert a dataset into an XML schema file that I can
use to generate another Crystal Report.

Thanks in advance for any help that you can give me.
 

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