Re: Web service to return xml file



{\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 }

Relevant Pages

  • Re: XMLWriter / Reader
    ... Tom give this a shot, ... I want to do this using XML. ... > stream or straight to the a string variable. ... I am very new to both C# and the .Net Framework. ...
    (microsoft.public.vstudio.general)
  • Re: Check wellformedness of XML
    ... > Hi Tom, ... > You can read the XML with XmlTextReader. ... To quote MSDN: ... > "The XmlTextReader class is an implementation of XmlReader, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: what sort of app is this
    ... so that will be the way I will proceed..My little app just ... needs to do some HTTP calls and read/write to a local XML file ... ... found some usefull looking URL classes in the framework, ... Tom "Tom" Harrington ...
    (comp.sys.mac.programmer.help)
  • Re: Accessing data from an MS Access database on a remote web serv
    ... Tom wrote: ... I think you're not getting the XML ... >> stream so the connection on yopur local server is invalid. ... This email account is my spam trap so I ...
    (microsoft.public.inetserver.asp.db)
  • Re: How to dynamically resize an array?
    ... work with XML data, and that is DOM which loads the entire XML document model ... even with LINQ - but, LINQ is definately easier and more straight forward. ... Its used in other technologies too, like CSS, DOM and now that Microsoft officially supports jQuery in ASP.NET, XPATH DOM element look ups is supported. ...
    (microsoft.public.dotnet.languages.vb)

Loading