By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,783 Members | 1,347 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,783 IT Pros & Developers. It's quick & easy.

SqlDataAdapter.Fill and DataRow.RowSate

P: n/a
Hello All,

I use a dataadapter to fill a datatable from a sql server table. The
datatable contains one column ROW_ID which is set as the PrimaryKey.

The sql server table contains a single row and no new rows are added
between refreshes.

I refresh the datatable every 3 minutes using the dataadapter.fill
method.

The primary key prevents the same record being added but I'm confused
as to why the fill method triggers the DataRowChangeEventArgs event
with an action of type change and the datarow rowstate is set to
modified. ?

Thanks in advance
hharry

Jan 26 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
The help on DataAdapter.Fill mentions that when additional calls to
fill the DataSet are made, the primary key column information is used
to match rows from the data source with current rows in each DataTable,
and current data in the tables is overwritten with data from the data
source.

So, it sounds like your single row is being overwritten with each call
to Fill, and that would explain the change evnt being raised.

==================
Clay Burch
Syncfusion, Inc.

Jan 27 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.