Everything was work but in some moment stops.
I have GridView and sqldatasource with stored procedure and 4 parameters. DataBind simply not work anymore and gridview is empty. When i copy my stored procedure and make query in code and pass parameters everything is ok!!
Why?
Sachin SinghPosted Jan 18, 2023, 5:25 AM
yes, the Default value for CancelSelectOnNullParamter for SQLDatasource is true, you need to make it false.
Vishal JoshiPosted Jan 18, 2023, 5:03 AM
Hello
Please try the below code with the respective parameter name to get the store procedure to work with grid view. make sure you set the command type as CommandType.StoredProcedure.
Thanks
Jignesh KumarPosted Jan 18, 2023, 4:59 AM
Hello Zeljko,
Please check your SQLDatasourc below property and check,
SQLDatasourc -> Properites -> CancelSelectOnNullParamter = change it to false
Naimish MakwanaPosted Jan 18, 2023, 4:50 AM
Please refer below links. That would help you to solve your problem.
https://stackoverflow.com/questions/7114122/gridview-is-not-displayed-when-using-stored-procedure-in-sqldatasource
https://social.msdn.microsoft.com/Forums/en-US/e1133fb5-a628-41d0-a158-590bc6c76631/problem-with-gridview-and-stored-procedure?forum=aspwebformsdata
Thanks