473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

get fields from an xml schema

3
How can I get read the fields from an XML schema in C# to be able to use them to create and SQL Server database?
Mar 1 '09 #1
2 2388
jkmyoung
2,057 Expert 2GB
There's at least 2 questions there:

1. How to read XML?
Suggest using either a XMLDocument approach (DOM), or a SAX approach. With the Document approach, you load the entire xml into a document and query the nodes you want to find by means of xpath, or parent-child relations between the nodes.

With the SAX approach, you read the document as a stream, loading the fields as you need it.

2. Create a SQL Server DB from XML information.
Unless you have a flat xml, or one that is prestructured in some given way, you will need to define how your xml maps to the tables. Short answer, you need to know a specific format of your schema for it to work.

Do you have keys and keyrefs in your xml schema?
Mar 2 '09 #2
MosheY
3
Thanks for the reply.

I don't have any keys in the schema. I created it from one table in Access.

I actually worked out a way to get the fields by reading the xml file into a dataset and then getting the column captions. This helps me for the field names, but I would also like to able to read the types, lengths and other information if possible.
Mar 2 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Maciej Zoltowski | last post by:
Hi, I've got a following problem with the order of fields in extended element: let's assume, that I have a complex type with a few fields, that I want to extend with additional field. In...
0
by: Michael Herman \(Parallelspace\) | last post by:
Suppose I have two RDF files (and corresponding RDF Schema files) that are used to store calendar appointment information using different (RDF) schemas. Can Altova mapforce...
5
by: wooks | last post by:
I have defined a schema with an xsd:choice element for 2 mutually exclusive fields. When both are present I get an error which is good, but what is not so good is the error message which says...
2
by: Michael Hertz | last post by:
Assume there is a XSD schema which describes the maximum possible number of fields which can occur in a XML document. How do I create such a form either as a HTML form or a text file from the XSD...
6
by: allyn44 | last post by:
HI--what I am trying to do is 2 things: 1. Open a form in either data entry mode or edit mode depending on what task the user is performing 2. Cancel events tied to fields on the form if I am in...
2
by: svestin | last post by:
Hi All! I run into a problem defining a XSD schema with KEYREF references. Is it possible to use KEYREF with nillable fields? Just like a database where a FK could be null. In the example...
1
by: Le Tubs | last post by:
Hi I am wondering if anybody has come accross this problem before, basically I have to validate a xml schema (not the data, this is done at a later stage). The only problem is that there are...
2
by: xan2 | last post by:
Hi, I just want to know if it's possible to declare a value of a field in XML Schema depending to other fields. For example, suppose we have (in pseudo-xml not in xsd) a person who have this...
8
by: Wingot | last post by:
Hey, I have a program I am trying to write using Visual C#, SQL Server 2005/2008, and Visual Studio 2008, and one part of it includes a Schema called Client. Inside this schema, three tables...
9
muaddubby
by: muaddubby | last post by:
Hi I'm running into a scenario with a DataSet that has a schema loaded into it, tries to then load data (that matches the schema), and fails with a "Input string was not in a correct format"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.