Hi Jim,
Is your XML document list string xml format?
If it is, you can read your XML document into a stream, then you can use
DataSet.ReadXml (Stream) to convert it into a dataset.
At last, you can use DataSet.WriteXm l to generate a xml file.
For your problem of passing XML document to SQL Server Stored procedure, I
think you need expressing it more details.
What is the content of the xml file?
If it is used for updating the database, I think you should convert it as a
dataset and use SqlDataAdapter' s update method to update the database.
If it is used as some parameters of the stored procedure, you should set
the SqlCommand's commandtype to StoredProcedure and pass it into the
parameters collection of the stored procedure.
Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| From: "Jim H" <no****@jimsacc ount.com>
| Subject: Need help - Array to XML doc
| Date: Mon, 6 Oct 2003 19:45:21 -0400
| Lines: 13
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <##************ **@TK2MSFTNGP12 .phx.gbl>
| Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
| NNTP-Posting-Host: crlspr-24.233.164.226. myacc.net 24.233.164.226
| Path:
cpmsftngxa06.ph x.gbl!TK2MSFTNG XA06.phx.gbl!TK 2MSFTNGXA05.phx .gbl!TK2MSFTNGP 0
8.phx.gbl!TK2MS FTNGP12.phx.gbl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1894 07
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
|
| I am on a project where I am supposed to send an XML document to a SQL
| Server stored procedure.
|
| The XML Doc is a list strings. If in my c# function I get a list values
as
| (string[] psValueList), how would I create an XML document from that. I
am
| assuming that the XML doc will be treated as a table of values in the
stored
| procedure.
|
| Am I even asking the right question ro am I way off track?
|
| Jim
|
|
|