Traditional Culture Encyclopedia - Photography and portraiture - How can C# pass null values or null parameters to stored procedures ~

How can C# pass null values or null parameters to stored procedures ~

The first question, first of all, you make sure that the corresponding parameter is indeed provided in your sqlparameter parameter, and then assign DbNull.value to the parameter.

The second question, I think you should first make sure that there are results in the data source bound by datagridview. You can check by adding breakpoints. I guess the result in the data source is empty, probably because the parameter value you passed is wrong.