Hi Jeronimo,
Welcome to the ASPNET newsgroup.
From your description, I understand you have an ASP.NET 2.0 web page which
contains a GridView control displaying data from an ObjectDataSource
control. And the objectdatasource control's associated data access class
will return a DataSet which contains two datatables, you're wondering how
to make the gridView be able to bound to a specific datatable in the
DataSet rather than always hte default one, correct?
Based on my understanding, if we directly return a DataSet for data access
class(used in objectDataSource control), it will always return the
DefaultView of the default datatable(basically the first one). So what we
need to do is customize the Data Access class(which provide the select,
update .... methods). Is this class also developed by you or can you
directly modify it? If not, you may consider create a wrapper class which
encapsulate it.
In our customized class, we can add an additional parameter for the Select
method, this parameter is used to indicate which datatable to return. Then,
when bound to GridView and used in ObjectDataSource control, we just need
to define an additional paramters (control parameter or querystring or
....). How do you think of this?
Hope this helps.
Regards,
Steven Cheng
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)