data insert using input output stored procedure

前端 未结 3 1472
说谎
说谎 2021-01-22 21:20

I am creating a web application using ASP.net C#. I have a booking form and I need to insert data into a table using a Stored Procedure. The table has several columns, out of wh

3条回答
  •  执念已碎
    2021-01-22 22:04

    Use simple SqlCommand for calling your SP

    connection.Open();
    var cmd = new SqlCommand("sp_InsertCashPooja", connection);
    cmd.Parameters.AddWithValue("FirstName", frmFirstName);
    // Add all the others parameters in same way
    var id = (int)cmd.ExecuteScalar();
    connection.Close();
    

提交回复
热议问题