Link to home
Start Free TrialLog in
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
Avatar of Daniel Van Der Werken
Daniel Van Der Werken
Flag of United States of America image

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
Avatar of rowek
rowek

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rowek
rowek

ASKER

Once we took out the wildcard we got data from our Stored Procedure.