2009-07-02 47 views
0

這裏是我的背後代碼:過程或函數「usp_SendEmails」需要參數「@SchedId」,但未提供

protected void gvviewapproval_RowUpdated(object sender, GridViewUpdatedEventArgs e) 
    { 
     using (SqlConnection cn = new SqlConnection(Utilities.ConnectionString())) 
     { 
      using (SqlCommand cmd = new SqlCommand("usp_SendEmails", cn)) 
      { 
       cn.Open(); 
       cmd.CommandType = CommandType.StoredProcedure; 
       cmd.ExecuteNonQuery(); 
      } 
     } 

     gvviewapproval.DataBind(); 
    } 
} 
+0

我不認爲該錯誤信息可能會更加明確。 – 2009-07-02 14:58:14

回答

2

您需要在執行前添加一個名爲「@SchedId」的命令對象參數查詢。

cmd.Parameters.AddWithValue("@SchedId", 3); 
相關問題