SqlDataSource OnSelected Event Not Firing

G

Guest

I'm using a stored procedure as the select command for an SqlDataSource tied
to a GridView.

I've verified the sp returns rows in the Management Studio as well as in
VS2005 when I Configure the SqlDataSource and click the Test Query button.

However, when I run the website in VS2005, the GridView is empty, and when I
put a breakpoint in the SqlDataSource_OnSelected event handler, it never
breaks. The the SqlDataSource_OnSelecting event handler breaks when I put a
breakpoint in that event handler.

If I set the SqlDataSource SelectCommand to a valid SQL SELECT statement,
instead of calling the stored procedure, both breaks occur - one in the
OnSelecting event handler and one in the OnSelected event handler.

How can I use SQL Server 2005 stored procedures in SqlDataSource controls so
that they work?
 
Joined
Aug 23, 2006
Messages
1
Reaction score
0
Try setting the CancelSelectOnNullParameter Property to True

Try setting the CancelSelectOnNullParameter Property of the SQLDataSource to True
Otherwise the stored procedure is not executed if one of it's parameters is null.

br, Markus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top