Hi guys! can any one help me to know how we can execute stored procedures of SQL server in .net
executing Stroed procedures using .net
Collapse
X
-
Tags: None
-
Originally posted by cvraghavan1979Hi guys! can any one help me to know how we can execute stored procedures of SQL server in .net
Code:sqlConRowUpdate = new SqlConnection(strConnectionString); sqlConRowUpdate.Open(); SqlCommand SqlCmdRowUpdate = new SqlCommand(); SqlCmdRowUpdate.Connection = sqlConRowUpdate; SqlCmdRowUpdate.CommandText = "procUpdatePDetails"; SqlCmdRowUpdate.CommandType = CommandType.StoredProcedure; SqlCmdRowUpdate.Parameters.Add("@purchaseid", SqlDbType.VarChar).Value = strPurchaseId; SqlCmdRowUpdate.Parameters.Add("@productname", SqlDbType.VarChar).Value = strProductNameNew; SqlCmdRowUpdate.Parameters.Add("@noofitems", SqlDbType.Int).Value = intNoOfItems; SqlCmdRowUpdate.Parameters.Add("@priceperunit", SqlDbType.Int).Value = intPricePerUnit; SqlCmdRowUpdate.ExecuteNonQuery();
Regards,
Mathew. -
hi,
thank u mathew. i got an idea of using the stored procedures through the example given by you. thank u for ur timely help. looking forward for a good team work with u and other team members. Have A Nice Day!
regards,
vijayComment
Comment