locked
Access sqlDatasource values from code behind page RRS feed

  • Question

  • User801447716 posted

    Hi,

    I've seen an article somewhere on the web but have lost the link, but basically I have a datasource on my page which I have changed to a datareader, I would like to access some of the values from the datasource from code behind page how can I achieve this?

    Thanks

    Monday, April 22, 2013 5:04 AM

Answers

  • User-1716253493 posted
    to use datatable: DataTable dt= ((DataView)SqlDataSource1.Select (DataSourceSelectArguments.Empty)) .Table;
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 22, 2013 9:20 AM

All replies

  • User-1360095595 posted

    Handle the Selecting event and change the parameters/values there. 

    Monday, April 22, 2013 5:20 AM
  • User801447716 posted

    Actually it was using the page_load so I could set the value/s to any other controls. The senario is I use the ds for a gridview but I would also like to use one or two values on textboxes which do not form the gridview so would like to use the ds for this purpose.

    Monday, April 22, 2013 5:26 AM
  • User-1716253493 posted
    to use datatable: DataTable dt= ((DataView)SqlDataSource1.Select (DataSourceSelectArguments.Empty)) .Table;
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 22, 2013 9:20 AM