S
santel
Hi,
I tried the below code to convert the sql table to xmlDocument. But it
is giving error in doc.Load(reader) Could anyone please help me out.
conn.Open();
string sql = "select ProductId, ProductName from Products FOR
XML AUTO";
SqlCommand comm = new SqlCommand(sql, conn);
XmlReader reader = comm.ExecuteXmlReader();
XmlDocument doc = new XmlDocument() ;
doc.Load(reader);
reader.Close();
conn.Close();
return doc;
I tried the below code to convert the sql table to xmlDocument. But it
is giving error in doc.Load(reader) Could anyone please help me out.
conn.Open();
string sql = "select ProductId, ProductName from Products FOR
XML AUTO";
SqlCommand comm = new SqlCommand(sql, conn);
XmlReader reader = comm.ExecuteXmlReader();
XmlDocument doc = new XmlDocument() ;
doc.Load(reader);
reader.Close();
conn.Close();
return doc;