I'm doing an app which is initially a C# WinForms app where the users will connect via VPN.
At some point in the future it will be converted to a web app, so I want to use a WS up front.
I'm fairly new at this, and I've seen some examples, as well as prior postings with you and Bonnie
that got me going this way.
I didn't think you could pass a dataset through a WS into the back end.
>Hi,
>Sure it works. But why bother to convert to XML and back again.
>Why not let .NET take care of the plumbing.
>
>>Ok, this works.
>>
>>
>>public void UpdateUser(string sUserXML)
>>{
>>
>> StringReader oReader = new System.IO.StringReader(sUserXML);
>> DataSet oDataSet = new DataSet();
>> oDataSet.ReadXml(oReader);
>>
>>}
>>
>>
>>
>>The ReadXml method has an overload which accepts an XmlReadMode value. I tried several and it results in
>>an empty dataset. If I leave if off, the DS is populated.
>>
>>
>>
>>
>>
>>>>>>I am passing a dataset as XML to a web service, which then passes it to a data class where it will be 'onverted'
>>>>>>back into a data set.
>>>>>>
>>>>>>1) How to I get the XML back into a data set?
>>>>>>
>>>>>>2) How do I update the DB from the dataset?
>>>>>
>>>>>1) Look at the DataSet.ReadXML method.
>>>>
>>>>Actualy I found that, but it throws an exception "Illegal characters in path" error.
>>>>
>>>>[UPDATE] Looks like ReadXml is for reading from a file. I'm passing an XML string to
>>>>this method and want to put it back into a dataset.
>>>>
>>>>See this
http://www.java2s.com/Tutorial/CSharp/0540__XML/LoadXMLtoDataSet.htm>>>
>>>There are several overloads. Maybe the one reading in a stream is what you are looking for?
>>>
>>>>>
>>>>>2) I usually loop through the rows in the DataSet and save them one-by-one using normal ADO.NET methods. I know there are other fancier ways to do it with DataSets, but I am mostly a business objects guy so I don't know those offhand.
>>>>
>>>>Ok
>>>>
>>>>>
>>>>>3) You almost had me look up "onverted" in a dictionary before I realized the typo...
>>>>
>>>>Doesn't everyone 'onvert' their data?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people