Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dataset has data, but datagrid is not showing any rows
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01065655
Message ID:
01065692
Views:
16
Jim,

>I am using a business object "MyBusinessObject" that contains several methods that return datasets. One of those methods uses an Sql statement that includes a UNION between two tables and each of those tables also have one INNER JOIN with another table. Testing the Sql statement separately in Query Analyzer results in several rows being returned.

>In the business object method, after defining the Sql statement, the dataset is filled by using the following code (I am using GetDataSet overload #11):
>
>
>DataSet dsMyDataSet = this.GetDataSet(this.Sql, "MyTableName",
> this.CreateParameter("@MyParameter", myParameter));
>return dsMyDataSet;


>The datagrid that needs to show the data in dsMyDataSet has its properties set as follows:
>
>BindingSource: MyBusinessObject
>BindingSourceMember: MyTableName
>BindingSourceType: Default
>BindingType: OneWay
>
>When I run the application in debug mode, I can see that dsMyDataSet is filled with rows and columns. However, the datagrid does not show any data.

At first glance it looks like you are setting everything up correctly. Did you remember to register the business object with the web form? Have you specified columns for the DataGrid and are those binding properties correct? If you have specified columns have you unchecked the box "Create columns automatically at run time"?

If all of this seems right, I recommend setting a breakpoint in mmDataGrid.StateChangeHandler() to see if it gets hit. If so, you can step through the code to see what's happening at binding time. If not, there is something wrong with the registration of the business object and/or DataGrid. I recommend setting a breakpoint in mmBusinessWebPage.RegisterBoundControl() to see what's happening.

Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Reply
Map
View

Click here to load this message in the networking platform