Procedure or function expects parameter ' which is not supplied

后端 未结 2 1252
闹比i
闹比i 2021-01-29 12:11

hello friends i face one issue for load the data to grid view.

the page load event call the one method like loaddata() inside i write the code this

  usi         


        
2条回答
  •  无人共我
    2021-01-29 12:33

    The following parameters don't have default values in your stored proc:

    @DateEmailed datetime,            
    @DateResponded datetime, 
    

    So you always need to provide those values in the code:

    cmd.Parameters.Add(new SqlParameter("@DateEmailed", SqlDbType.DateTime));
    cmd.Parameters["@DateEmailed"].Value = DateTime.Now; // Provide your value here
    cmd.Parameters.Add(new SqlParameter("@DateResponded", SqlDbType.DateTime));
    cmd.Parameters["@DateResponded"].Value = DateTime.Now; // Provide your value here
    

提交回复
热议问题