We help IT Professionals succeed at work.

Bind resultset f/SP gridview

Last Modified: 2014-05-26
I am attempting to bind the resultset of a stored procedure to a GridView in ASP.NET. However, the resultset does not appear to be binding. I've stepped through my code and everything looks to be working just fine: my connection isn't getting lost and my parameters are passing through fine. I'm not even getting an error message! I'm just not getting a result set returned.  When I add a breakpoint and inspect the dataset object in the debugger, it is empty.

I have run the stored procedure in SSMS and have verified that I SHOULD be getting a result set returned. Below are my stored procedure and some of the code from my app.

Please tell me what I am doing wrong. Thanks.
Watch Question

Daniel Van Der WerkenIndependent Consultant

I think, since you have AutoGenerateColumns = false, that you need to manage the event OnRowDataBount() yourself:

You could try setting this value to "true" and then see if you get columns created with rows populated. After that, create this event in the code and work with it to assign the column values per row as described in the MSDN article.
This one is on us!
(Get your first solution completely free - no credit card required)


Once we took out the wildcard we got data from our Stored Procedure.
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.