Re: Web service to return xml file
- From: stcheng@xxxxxxxxxxxxxxxxxxxx ("Steven Cheng")
- Date: Fri, 10 Oct 2008 03:28:06 GMT
{\rtf1\ansi\ansicpg936\deff0\deflang1033\deflangfe2052{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\lang2052\f0\fs20 Thanks for your reply Tom,
\par
\par I'm glad that the suggestion helps you. If you encounter any further issues or need any help later, please feel free to let me know.
\par
\par Sincerely,
\par
\par Steven Cheng
\par
\par Microsoft MSDN Online Support Lead
\par
\par
\par Delighting our customers is our #1 priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please feel free to let my manager know what you think of the level of service provided. You can send feedback directly to my manager at: msdnmg@xxxxxxxxxxxxxx
\par
\par \pard\li720 --------------------
\par From: "TompIfe" <tpskonto@xxxxxxxxxxxxxxxx>
\par Subject: Re: Web service to return xml file
\par Date: Thu, 9 Oct 2008 15:42:39 +0200
\par
\par Hi Steven,
\par I have used your code example to create web methods that return xml files,
\par and they work perfectly fine.
\par Thank you for your assistance,
\par Tom Pedersen
\par ""Steven Cheng"" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
\par news:RoDAENTKJHA.4620@xxxxxxxxxxxxxxxxxxxxxxxxx
\par > Hi Tom,
\par >
\par > Nice to hear from you.
\par >
\par > AS for LINQ to XML, it can help conveniently generated xml document from a
\par > certain object collection together with LINQ to object. Are you using
\par > VB.NET or c#(vb.net has provided more advanced support on LINQ to XML).
\par >
\par > Here I use a SQLServer data accessing case t demonstrate (should be the
\par > same code logic for Access Database). I use datareader to retrieve data
\par > and LINQ to XML to compose the XML document from the data:
\par >
\par > =============================
\par > private static void Run_LINQ()
\par > \{
\par > string connstr = "Data Source=localhost;Initial
\par > Catalog=testdb;Integrated Security=True";
\par > string sqltxt = "select [id],[name] from edit_table";
\par >
\par >
\par > using (SqlConnection conn = new SqlConnection(connstr))
\par > \{
\par > conn.Open();
\par >
\par > SqlCommand comm = new SqlCommand(sqltxt, conn);
\par >
\par > IDataReader reader = comm.ExecuteReader();
\par >
\par > XDocument doc = new XDocument();
\par >
\par > XElement root = new XElement("root");
\par >
\par > while (reader.Read())
\par > \{
\par > root.Add(
\par > new XElement("Item",
\par > new XElement("id", reader["id"].ToString()),
\par >
\par > new XElement("name",reader["name"].ToString())
\par >
\par
\par }
- References:
- RE: Web service to return xml file
- From: "Steven Cheng"
- RE: Web service to return xml file
- From: "Steven Cheng"
- Re: Web service to return xml file
- From: TompIfe
- RE: Web service to return xml file
- Prev by Date: WCF Security: How restrict an endpoint to only response to a given windows user or group?
- Next by Date: RE: WCF Security: How restrict an endpoint to only response to a given windows user or group?
- Previous by thread: Re: Web service to return xml file
- Next by thread: I need to return dataset in XML format so Flash can read it properly.
- Index(es):
Relevant Pages
|
Loading