AnuLakshmi M

AnuLakshmi M

  • 2k
  • 12
  • 2.6k

C# Code For Execute Stored Procedure

Sep 10 2014 10:05 AM
SqlConnection cnn = new SqlConnection();
cnn.ConnectionString = ConfigurationManager.ConnectionStrings["supermarket_webConnectionString"].ConnectionString;


SqlConnection objConnect = cnn;
SqlCommand cmd = new SqlCommand("p_NewpurchaseOrder", objConnect);
cmd.CommandType = CommandType.StoredProcedure;

SqlParameter parXmlPurchaseItems = new SqlParameter("@xml_OrderPurchItems", SqlDbType.VarChar);
parXmlPurchaseItems.Value = XmlPurchaseOrderItems;
cmd.Parameters.Add(parXmlPurchaseItems);


cmd.ExecuteNonQuery();

Answers (4)