Jim, any SQLDataSource should be able to do this, but I dont believe
you can write such a statement in the VS2005 wizard for creating the
data source. Instead, you will have to go into your code and write your
own SQL statement.
Try modifying this with your own connection string and sql string and
then set the GridView / DataGrid / whatever to use it as a data source.
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT COUNT(*) FROM [Table]">
</asp:SqlDataSource>
Jeff
Jim McGivney wrote:
I would like to return one specific value from an SQLDataSource configured
to a table with an SQL Command selecting a specific value.
It would be the equilivant of ExecuteScalar in OLEDB.
Replies with code would be appreciated.
Thanks Jim