FormViewUpdateEventHandler

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

If I create a FormView dynamically, I need to create the NewValues
manually. This is confirmed by multiple locations in the docs
including FormViewUpdateEventHandler. The oldValues returned by
FormViewUpdateEventHandler is also null. Do I need to fill it in as
well? IF so, how do I get to the data. DataItem is returning null for
me...
 
DataItem returns null because it only returns something other than null
after a databind. A postback of an update will presumably update the
values before it attempts to do a databind: it makes no sense to bind
data that is about to change.

I can make a call to SqlDataSource.Select in the
FormViewUpdateEventHandler in order to grab the data, but I'm worried
that this is reissuing the query. (It may not be, but the caching
parts of the doc are a little hard to understand on first perusal.)

Generally, why is the underlying dataset so 'protected' in
SqlDataSource.

On a related point, if I want to create SqlDataSource dynamically, I
have no CommandBuilding kind of stuff like with DataAdapter, DataSet
etc. And yet, if I don't use SqlDataSource and I create a FormView
dynamically, I have to do a lot of the code leg work myself like
handling record navigation etc. I'm having a hard time understanding
why SqlDataSource seems to be so 'separate' from the rest of the
architecture. Any comments on that?
 

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

Back
Top