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
Title:
Dataset has data, but datagrid is not showing any rows
Environment versions
Environment:
C# 1.1
OS:
Windows XP SP2
Database:
MS SQL Server
Miscellaneous
Thread ID:
01065655
Message ID:
01065655
Views:
57
Hi,

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.

The MM.Net Developer Guide states the following:
"If you don't specify any other binding properties, the DataGrid is bound to the business object's default DataTable (specified in the business object's TableName) property. If you want to bind the DataGrid to a different table, specify the table name in the DataGrid's BindingSourceMember property."

I am assuming that using GetDataSet overload# 11, which sets the tablename, would do the trick. What is missing or what am I doing wrong?
Next
Reply
Map
View

Click here to load this message in the networking platform