How to pass a null variable to a SQL Stored Procedure from C#.net code

前端 未结 8 449
失恋的感觉
失恋的感觉 2020-12-02 19:41

Im calling a SQL stored procedure from a piece of C#.net code:

SqlHelper.ExecuteDataset(sqlConnection, CommandType.StoredProcedure, STORED_PROC_NAME, sqlPara         


        
8条回答
  •  情书的邮戳
    2020-12-02 20:29

    SqlParameters[1] = new SqlParameter("Date1", SqlDbType.SqlDateTime);
    SqlParameters[1].Value = DBNull.Value;
    SqlParameters[1].Direction = ParameterDirection.Input;
    

    ...then copy for the second.

提交回复
热议问题