Hello Dick,
As Eliyahu has suggested, one way is to directly assign the DataSet object
to DataBound control(such a gridview)'s Datasource property and set the
proper "DataMember ". This is just like the programmatic databinding in
ASP.NET 1.X.
If you want to utilize the ObjectDataSourc e declarative databinding, you
can consider creating a wrapper class which expose a Select method that
will return the certain DataTable(from internal DataSet object) according
to a given input parameter(selec t parameter in DataSource control). e.g.
=============== ===============
public class WrapperClass
{
private MyDataSet _dataset;
public WrapperClass()
{
_dataset = new MyDataSet();
//fill in datatables here
}
public DataTable Select(string tablename)
{
return _dataset.Tables[tablename];
}
}
=============== =============== =
In the ObjectDataSourc e, you can supply this parameter through the
DataSource control's "Select" parameter collection(from any available
parameter sources or directly embeded in it)
===============
<asp:ObjectData Source ID="ObjectDataS ource1" runat="server"
SelectMethod="S elect"
TypeName="Wrapp erClass">
<SelectParamete rs>
<asp:ControlPar ameter ControlID="Labe l1" Name="tablename "
PropertyName="T ext" Type="String" />
</SelectParameter s>
</asp:ObjectDataS ource>
=============== ===========
Hope this helps.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.