Eng Posted May 5, 2004 Posted May 5, 2004 I don't know much about this XML stuff other than the buzz words that accompany it, such as XSD and XSLT. I am trying to find out if there a way to capture the relational data information into a XML File? For instance, say for simplicity sake, I have a customer information(from Customer Table) and the order information (from Order Table). In my relational database, I have Customer Key as Primary Key to the Customer Table and it is a Foreign Key to the Order Table. 2 questions: 1.) If I have the data in XML file that keeps track of each customer and their orders, how/where will that relation show up? Will that be in the XSD Schema? 2.) Is it possible (any example) to read the XML/XSD file that contains the relation information into an ADO.NET dataset with the same relation being captured? Any help, solution or direction, to the answers to my questions, is appreciated. Quote
jccorner Posted May 5, 2004 Posted May 5, 2004 If you're using a dataset, you can write the tables to the XML file by using the WriteXMLSchema property. strSql = "Select * From Customers" DA = New OleDbDataAdapter(strSql, Connection) DA.Fill(DS, "Customers") DS.WriteXMLSchema("C:\SomeFolder\MySchema.xsd") Quote Applying computer technology is simply finding the right wrench to pound in the correct screw
Eng Posted May 5, 2004 Author Posted May 5, 2004 I guess my questions were too general. I wil not be writing to the XML file. Here is an expansion to my questions: 1.) We are planning to receive some XML files, along with their schema, from another party. The original files (XML, XSD) that we are receiving currently do not have any sort of identifier as to if any 'relations' exists within each element within the XML data. Looing at the data, we know that there are "relations" among those elements. Since I don't know much about the XML technology, I wanted to know if setting the relations could be done within the XML/XSD files -- before asking the third party to give us that sort of format in their file. I am not sure how they get thier XML/XSD files created so this may not be .NET specific, but XML technology in general. 2.) If let's say, the third party can provide us with the "relation" information in thier XML/XSD files ( I am being optismistic here), I am wondering if I read their files into the ADO Dataset, will it recognize the 'relations' given from thier files? In other word, without adding the relations in my dataset manually -- but, read it programmatically using their XML/XSD files. I haven't seen any examples on doing that. Quote
Moderators Robby Posted May 5, 2004 Moderators Posted May 5, 2004 Using an XSD http://samples.gotdotnet.com/quickstart/util/srcctrlwin.aspx?path=/quickstart/howto/samples/Xml/DataSetMapXSDSchema/cs/&file=books.xsd you can create dataset mapping http://samples.gotdotnet.com/QuickStart/howto/default.aspx?url=/quickstart/howto/doc/Xml/DataSetMapXSDSchema.aspx Quote Visit...Bassic Software
Eng Posted May 5, 2004 Author Posted May 5, 2004 Thank you! The site should give me a good jump start. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.