G
Guest
Here is what I have tried, including the lines I commented in and out...
SqlConnection cnn = new SqlConnection("Data Source=(local); database=Pubs;
Integrated Security=SSPI");
SqlCommand cmd = cnn.CreateCommand();
cmd.CommandType = System.Data.CommandType.Text;
cmd.CommandText= "SELECT * FROM jobs FOR XML AUTO, ELEMENTS, XMLDATA";
cnn.Open();
XmlReader xr = cmd.ExecuteXmlReader();
DataSet ds = new DataSet();
ds.ReadXml(xr);
//ds.ReadXmlSchema(xr);
XmlDataDocument xd = new XmlDataDocument(ds);
xr.Close();
xr = cmd.ExecuteXmlReader();
//xr.MoveToContent();
ds.ReadXml(xr);
//ds.ReadXml(xr,XmlReadMode.IgnoreSchema);
//xd.Load(xr);
ds.WriteXml(@"c:\pubjobs.xml",XmlWriteMode.DiffGram);
Thanks in advance for your help...
Dave
SqlConnection cnn = new SqlConnection("Data Source=(local); database=Pubs;
Integrated Security=SSPI");
SqlCommand cmd = cnn.CreateCommand();
cmd.CommandType = System.Data.CommandType.Text;
cmd.CommandText= "SELECT * FROM jobs FOR XML AUTO, ELEMENTS, XMLDATA";
cnn.Open();
XmlReader xr = cmd.ExecuteXmlReader();
DataSet ds = new DataSet();
ds.ReadXml(xr);
//ds.ReadXmlSchema(xr);
XmlDataDocument xd = new XmlDataDocument(ds);
xr.Close();
xr = cmd.ExecuteXmlReader();
//xr.MoveToContent();
ds.ReadXml(xr);
//ds.ReadXml(xr,XmlReadMode.IgnoreSchema);
//xd.Load(xr);
ds.WriteXml(@"c:\pubjobs.xml",XmlWriteMode.DiffGram);
Thanks in advance for your help...
Dave