שליחה וקבלת פרמטרים
אפשר בדרך הבאה: SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]); SqlCommand myCommand = new SqlCommand("ProductDetail", myConnection); // Mark the Command as a SPROC myCommand.CommandType = CommandType.StoredProcedure; // Add Parameters to SPROC SqlParameter parameterProductID = new SqlParameter("@ProductID", SqlDbType.Int, 4); parameterProductID.Value = productID; myCommand.Parameters.Add(parameterProductID); SqlParameter parameterModelName = new SqlParameter("@ModelName", SqlDbType.NVarChar, 50); parameterModelName.Direction = ParameterDirection.Output; myCommand.Parameters.Add(parameterModelName); myConnection.Open(); myCommand.ExecuteNonQuery(); myConnection.Close(); סליחה על הבלאגן שנוצר כאשר כותבים פה באנגלית. בעקרון, צריך להגדיר connection ו-command כ-stored procedure ואז להגדיר פרמטרים. זה ממש בתימצות, אם תרצה אני אשלח לך קוד יותר מסודר למייל. בהצלחה