No control over SqlDataSource and databinding

R

rb

I'm struggling with (probably) basic things using SqlDataSource and
DataList. Here's the problem:

I need to read the resultset returned by SqlDataSource to perform
actions related to visual feedback and they should happen before
databinding happens. So far, I tried to manually call Select to return
DataView which then allows me to walk the DataView.Table.Rows. This is
cool but then automatic databinding (DataList) kicks in and Select
gets executed again. If I try to prevent it (e.Cancel in
SqlDataSource.Selecting), the DataList displays nothing.

So, here is/are the question(s):

1. Is there a better way to read the data out of resultset *before*
databinding happens?

2. Is there an equivalent to DataList.ItemDataBound only that fires
*before* binding and that allows me to allow or disallow binding to
that particular row?

3. Is it possible to prevent auto databinding? I read somewhere that
assigning DataSource instead of DataSourceID should do the trick.
However, Page.DataBind() reported error (something about View) and
DataList.DataBind() invoked SqlDataSource.Select() again.

Any idea/direction/suggestion would be very much appreciated.

Thanks.

rb
 

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,776
Messages
2,569,603
Members
45,197
Latest member
ScottChare

Latest Threads

Top