[WebMethod(Description = " Insert order from
XML")]
public int
InsertOrderFromNode(XmlNode aNode)
{
DataSet1 ds = new DataSet1();
oleDbDataAdapter1.SelectCommand.CommandText =
"Select * From Orders ORDER BY OredrID";
oledbDataAdapter1.Fill(ds, "Orders");
DataRow drLast =
ds.Orders.Rows[ds.Orders.Rows.Count - 1];
int LastOrderID =
Convert.ToInt32(drLast["OrderID"]);
DataSet1.OrdersRow dr = ds.Orders.NewOrdersRow();
dr.OrderID = LastOrderID + 1;
dr.OrderDate = Convert.ToDateTime(aNode["OrderDate"].InnerText);
dr.ShipName = aNode["ShipName"].InnerText;
dr.ShipAddress = aNode["ShipAddress"].InnerText;
dr.ShipCity = aNode["ShipCity"].InnerText;
dr.ShipCountry = aNode["ShipCountry"].InnerText;
dr.ShipPostalCode = aNode["ShipPostalCode"].InnerText;
ds.Orders.AddOrdersRow(dr);
oleDbDataAdapter1.Update(ds, "Orders");
return dr.OrderID;
}