public int AddOrders(string sOrderID, string sProductID, double nQuantity, double nUnitPrice) { string sConn=System.Configuration.ConfigurationManager.ConnectionStrings["Conn"].ToString(); string sSQL = "INSERT INTO [Order Details] "+ "(OrderID, ProductID, Quantity, UnitPrice) "+ "VALUES @OrderID, @ProductID, @Quantity, @UnitPrice)"; SqlConnection oConn = new SqlConnection(sConn); SqlCommand oCmd = new SqlCommand(sSQL, oConn); oCmd.CommandText = sSQL; oCmd.CommandType = CommandType.StoredProcedure; oCmd.Parameters.Add("@OrderID", SqlDbType.Int); oCmd.Parameters.Add("@ProductID", SqlDbType.Int); oCmd.Parameters.Add("@Quantity", SqlDbType.Double); oCmd.Parameters.Add("@UnitPrice", SqlDbType.Double); oCmd.Parameters[0].Value = sOrderID; oCmd.Parameters[1].Value = sProductID; oCmd.Parameters[2].Value = nQuantity; oCmd.Parameters[3].Value = nUnitPrice; oCmd.Connection = oConn; oConn.Open(); int nRowsInserted = oCmd.ExecuteNonQuery(); oConn.Close(); oCmd = null; return nRowsInserted; }Note: It reads the connection string from Web.Config