xml string - validation with typed dataset

  • Thread starter Thread starter R.A.
  • Start date Start date
R

R.A.

Hi

I have the following method:

public string FindNameList (string XmlStore)


I have a dataset based on xml schema. I have created the schema in vs editor
and created the dataset based on the schema.
When The 'FindNameList' method gets called it needs to take the input string
and construct the dataset.
The questions I have:
1) How do I load the string xml into the dataset
2) How do I get notified if there are some errors with the input xml - where
is the validation happens?


Please reply specifically for this scenario.
I am using .Net with c#


Thanks
 
R.A.,

To load a string into the data set, you can use the ReadXml method on
the DataSet. You would pass in a StringReader instance, which is
initialized with the XML string.

If there is an error parsing the XML, I imagine the data set would throw
an exception, so you would want to catch it if this happens.

Hope this helps.
 
Back
Top