Writing to a Database
private void PlaceOrder(XmlReader order) {
// Load XML into a document
XmlDocument xmlOrder = new XmlDocument();
// Create a Command to insert the order
SQLConnection sqlConn = new SQLConnection(ConnStr);
SQLCommand sqlCommand = new SQLCommand(
"Insert into Orders(OrderInfo)Values(@xmlInfo)", sqlConn);
// Add a parameter for the order
sqlCommand.Parameters.Add(
new SQLParameter("@XmlInfo", typeof(String), 1024));
sqlCommand.Parameters["@xmlInfo"].Value = xmlOrder.OuterXml;