PC Review


Reply
Thread Tools Rate Thread

DataTable ColumnChanging event nit firing on adaptor.Fill()

 
 
=?Utf-8?B?QW1pciBUb2hpZGk=?=
Guest
Posts: n/a
 
      23rd Aug 2007
Hi

I am successfully filling my DataSet with data using an adaptor. Prior to
calling Fill(), I regsiter handler for the ColumnChanging event of each
DataTable in my DataSet because I want to do field level validation of each
data item.

Unfortunately, my event handler is NOT getting called! Does this mean that
DataTable events do not fire during a Fill() and that they only fire AFTER a
DataTable has been filled with data? I hope not.

By the way, if I Fill from XML my event handlers do get called as the tables
are being filled - it is only when I go to Oracel, Sql Server and Sybase
(yep, we use them all!) that the handlers do not get called.

Any help on this would be much appreciated.
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QW1pciBUb2hpZGk=?=
Guest
Posts: n/a
 
      23rd Aug 2007
Turns out this is a design feature!!!

I found the following note on MSDN

Most operations that add or delete rows do not raise the ColumnChanged and
ColumnChanging events. However, the ReadXml method does raise ColumnChanged
and ColumnChanging events, unless the XmlReadMode is set to DiffGram or is
set to Auto when the XML document being read is a DiffGram.

see http://msdn2.microsoft.com/en-us/library/w9y9a401(VS.80).aspx


"Amir Tohidi" wrote:

> Hi
>
> I am successfully filling my DataSet with data using an adaptor. Prior to
> calling Fill(), I regsiter handler for the ColumnChanging event of each
> DataTable in my DataSet because I want to do field level validation of each
> data item.
>
> Unfortunately, my event handler is NOT getting called! Does this mean that
> DataTable events do not fire during a Fill() and that they only fire AFTER a
> DataTable has been filled with data? I hope not.
>
> By the way, if I Fill from XML my event handlers do get called as the tables
> are being filled - it is only when I go to Oracel, Sql Server and Sybase
> (yep, we use them all!) that the handlers do not get called.
>
> Any help on this would be much appreciated.

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS Adaptor SelectedNodeChanged event not firing Chris Microsoft ASP .NET 0 6th May 2007 08:59 PM
Click event getting lost during ColumnChanging event if modal dial =?Utf-8?B?RXFEZXY=?= Microsoft Dot NET Framework Forms 4 14th Aug 2006 09:25 AM
rowchanged event not firing on fill method Bernie Yaeger Microsoft ADO .NET 8 30th Nov 2003 09:06 PM
Rejecting changes on DataTable.ColumnChanging event SerGioGio Microsoft ADO .NET 4 18th Nov 2003 02:55 PM
DataTable.ColumnChanging Event for a databound control Duray AKAR Microsoft ADO .NET 0 18th Sep 2003 05:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:17 PM.