Do you mean you want to load data into the
Datatable
from an
ObjectDataSource
? If so, technically it's possible but pointless. The role of the
ObjectDataSource
is to
declaratively
bind data to a control. You would need to create a method to load it into something (such as a
DataTable
, or more likely a
List<myobject></myobject>
) before the
ObjectDataSource
control could work with it.
ObjectdataSource
controls are not data containers. They are simply a means of pointing to a method that returns data in one form or another.
REF
If you are looking for Connecting an ObjectDataSource to a DataTable then try the following:
Connecting an ObjectDataSource to a DataTable in Code-behind