AnuLakshmi M

AnuLakshmi M

  • NA
  • 12
  • 3.3k

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)