Search code examples
asp.netdatasourcedatasourceview

Asp.net Datasource - view sql data by lookin at datasource object?


Is there a way to view data that is returned from db by looking at DataSource or DataSourceView object in codebehind? I'm trying to view DataSourceView in debug but I don't see the data returned.


Solution

  • DataView dv = (DataView) YourDataSourceObject.Select(DataSourceSelectArguments.Empty);
    for (int i = 0; i < dv.Table.Rows.Count; i++)
    {
        string c = dv.Table.Rows[i]["c"].ToString();
    }