471,077 Members | 793 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,077 software developers and data experts.

No control over SqlDataSource and databinding

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
Oct 20 '06 #1
0 1098

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by bpd | last post: by
3 posts views Thread by =?Utf-8?B?QW5nZWw=?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.