I have a table with xml data type on one of the columns. Does anyone have code to read the xml from the table into an XmlDocument variable in C#.net
System.Xml.XmlDocument xmlNotification = new System.Xml.XmlDocument();
SqlConnection cnn = new SqlConnection("Data Source=XXXXx;Initial Catalog=MCC;Persist Security Info=True;User ID=user;Password=pass");
string cmdText = "select NotificationXML from _TaskNotificationXML where MCCTaskID = " + mccInspectionTaskNo;
SqlCommand cmd = new SqlCommand(cmdText, cnn);
cnn.Open();
xmlNotification = "fill in the blank";
cnn.Close();
cnn.Dispose();
Start Free Trial