Question about data into XSDs

  • Thread starter Thread starter tim almond
  • Start date Start date
T

tim almond

Hope someone can help me here...

I have written a crystal report that works off a 3 table XSD which is
stored in C#, but I'm having trouble getting data in there, particularly
in relation to mapping.

I'm running an SP to get one set of data, but I get a mapping error when
I try and map it to a data table in the XSD.

What's the best way of doing this, and can anyone point me at any
examples/articles? I'm wondering if outputting the SP results as XML
would be better, for instance.

Thanks in advance,
Tim Almond
 
Use TableMappings on the DataAdapter to ensure the names are exactly the
same as the names in the XSD. By default, the names of the tables in a
DataSet are Table, Table1, Table2 ... Table[N+1]. If the names do not match
exactly, you will have an error. Also, make sure you are pulling the correct
columns.

The easiest way to sync is to create a routine that pulls the data. Then
write off the XML schema and use it as your XSD. The table names will match
whatever you originally pulled, so make sure you have the TableMappings set
appropriately. You can then use the original routine to fill the
Strongly-Typed DataSet you created from the XSD. After a couple of times of
doing this, you will easily be able to do it without writing out the XSD in
this manner.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
Cowboy said:
Use TableMappings on the DataAdapter to ensure the names are exactly the
same as the names in the XSD. By default, the names of the tables in a
DataSet are Table, Table1, Table2 ... Table[N+1]. If the names do not match
exactly, you will have an error. Also, make sure you are pulling the correct
columns.

The easiest way to sync is to create a routine that pulls the data. Then
write off the XML schema and use it as your XSD. The table names will match
whatever you originally pulled, so make sure you have the TableMappings set
appropriately. You can then use the original routine to fill the
Strongly-Typed DataSet you created from the XSD. After a couple of times of
doing this, you will easily be able to do it without writing out the XSD in
this manner.

Thanks Gregory, I'll try that. I'll look into how to write the
relationships between the datatables too.

It's just that Crystal Reports seems to work very nicely with XSDs.
 
Back
Top