Avatar of rowek
rowek
 asked on

Bind resultset f/SP gridview

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.
HelpWithSPandGridView-ASP.txt
HelpWithSPandGridView-SP.txt
HelpWithSPandGridView-VB.txt
Visual Basic.NETASP.NETMicrosoft Development

Avatar of undefined
Last Comment
rowek

8/22/2022 - Mon
Daniel Van Der Werken

I think, since you have AutoGenerateColumns = false, that you need to manage the event OnRowDataBount() yourself:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-3

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.
ASKER CERTIFIED SOLUTION
rowek

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
rowek

ASKER
Once we took out the wildcard we got data from our Stored Procedure.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23