none
Where is the Dataset/DataTable when using SqlDatasource? RRS feed

  • Question

  •  

    I know using the Select method of SqlDatasource will result to a castable DataView. My question is about a wiring up SqlDatasource with a GridView. In ASP.NET databinding will happen automatically. Let say in the DataBound event of the GridView, I need the DATATABLE and also the first DATAROW, how do you get to these information?
    Wednesday, December 12, 2007 5:41 PM

All replies

  • I don't think you can.  I am trying to find out the same things and am coming to the conclusion that we all are much better just ignoring the SqlDataSource.  It is unreliable and unconfigurable.  It does not provide the degree of control real applications need.  I have wasted a week trying to get the 'new' data access methods to work and either the configuration tools mees up the job or essential details are unreachable.

    SqlDataSource is just another bad idea poorly executed.

    Monday, September 27, 2010 1:40 PM
  • Wow, 2010 already and still has no possible solution to this.
    Tuesday, October 19, 2010 9:07 PM
  • DataView view = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);

    DataTable table = view.ToTable();
    DataSet ds = new DataSet();
    ds.Tables.Add(table);


    Sunday, March 27, 2011 5:11 PM
  • MykelSilver,

    We are trying to get the original DataTable instance that is associated with the DataView.

    Friday, April 29, 2011 8:46 PM