Hope this isn't too stupid a question :)
I can bind an objectdatasource to a gridview very easily (and there's a
thousand tutorials of this on the net).
BUT!
I just want to get at the data so I can say put it in a label.text, or
similar. I've set an objectdatasource up that gets one record from my table,
representing a customer, and I just want to for example to display the
customer name somewhere on the page (other than via a gridview). I think I
was hoping for some sort of MyObjectDataSource.Table property so that I
could start getting at the returned values.
Please help! I'm sure it's ridiculously easy but it's not obvious to little
old me who until now thought .net 2 was looking oh so shiny.
Thanks a lot!
Ian
protected void ActionsDataSource_Selected(object sender,
ObjectDataSourceStatusEventArgs e)
{
dt = (ObjDataSet.ActionseDataTable) e.ReturnValue;
foreach (xx in dt)
{
}
}
But this result doesn't have the FilterExpression applied (it's the
datatable, not the dataview). dt.DefaultView doesn't work either, so if
anyone knows how to access the filtered results let me know!
I think you can also manually bind the objectdatasource, that way calling
your business object yourself, and manipulating the resultant dataset before
binding.
John
"Ian" <pleas...@Iwantnospam.com> wrote in message
news:t5ednbJ-7bo...@eclipse.net.uk...
<asp:FormView ID="FormView1" runat="server"
DataSourceID="ObjectDataSourceMain" AllowPaging="True">
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("LocationCode")
%>' />
</ItemTemplate>
</asp:FormView>
You may or may not need paging depending on the number of records returned
by your data object.
Hope this helps,
--
Andrew Robinson
http://blog.binaryocean.com
"Ian" <pleas...@Iwantnospam.com> wrote in message
news:t5ednbJ-7bo...@eclipse.net.uk...