Retrieving data from an sqldatasource

S

Samy

Hi,

I have an sqldatasource declaratively declared in a user control. I
would like to access the dataretrieved by it in the code when it is
bound for the first time. I am trying to do that in the onselected
event of the sqldatasource, but for some reason it seems to hit the
database whenever i call the select method in the selectedeventhandler
like this..

public void SaveIds(object sender, SqlDataSourceStatusEventArgs e)

{

SqlDataSourceView IdSourceView = (SqlDataSourceView)sender;


DataView IdsView =
(DataView)IdSourceView.Select(DataSourceSelectArguments.Empty);

When I try to iterate the IdsView..execution never goes to the next
line after the above statement..

Above two statements are called repetitively oneafter the other for
some reason. If I trace the calls using profiler, the stored proc seems
to be called everytime the above select statement is called..

All I want is to select some ids from the first call which I am unable
to accomplish. Can anybody please let me know why this has been
happening? Do I need to enablecaching to use the onselected event? I
already have the datasourcemode set to dataset.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top