I have a GRIDVIEW I have bound to an OBJECTDATASOURCE that has the select pointing to a class method that uses ADO to grab a dataset from SQL Server Stored Procedure. One of the columns that comes back I am not interested for the Grid, But I would like the first ROW's value for a label. I could do another IO to go get this, but Is there any way I can extract this data from the DATASOURCE directly in the Codebehind? Thanks for any help or information.
Why are you using ObjectDataSource if the database is Sql Server? SqlDataSource provides property DataSourceMode that can be used for getting a DataTable object from the datasource. Look here for details: How to get DataTable out of SqlDataSource http://msmvps.com/blogs/egoldin/archive/2006/12/27/how-to-get-datatable-out-of-sqldatasource.aspx -- Eliyahu Goldin, Software Developer & Consultant Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin "jobs" wrote in message news:1186707310.740980.109150@i38g2000prf.googlegroups.com... > I have a GRIDVIEW I have bound to an OBJECTDATASOURCE that has the > select pointing to a class method that uses ADO to grab a dataset from > SQL Server Stored Procedure. > > One of the columns that comes back I am not interested for the Grid, > But I would like the first ROW's value for a label. > > I could do another IO to go get this, but Is there any way I can > extract this data from the DATASOURCE directly in the Codebehind? > > Thanks for any help or information. >