Take the 2-minute tour ×

Is it possible to programmatically access items in sqldatasource once they are loaded? Context: sqldatasource is binded to list of checkboxes. When submitted, I have id of selected item, but I also need other information. So if I could acces loaded items in SqlDataSource that would suffice.

i know this is not very clear, I'm new to asp.net and it's so counter-intuituve.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

As long as the sqlDataSource has been setup to Cache the data (DataSourceMode="DataSet" EnableCaching="True") (See Caching Data with the SqlDataSource Control) then you can select cached items using the sqlDataSource in code like so:

DataView dataView = (DataView)sqlDataSource.Select(new DataSourceSelectArguments());
DataTable dataTable = dataView.ToTable();

The DataSourceSelectArguments class provides a means to specify the SortExpression amongst other things.

Hope this helps.

share|improve this answer
add comment

Your Answer


