473,397 Members | 2,116 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

SqlDataAdapter.Fill and DataRow.RowSate

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
1 3162
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: JEP | last post by:
I lifted the following code directly from MSDN examples. However, the update command fails against my Northwind/SQL Server database. The code is: Private Sub cmdStart_Click(ByVal sender As...
1
by: rkbnair | last post by:
In the below listed code, instead of using GetValue(2), is there any way to retrieve fields by calling the field name itself? (for example GetValue("str_mail_from") ?????) ...
3
by: Christoph | last post by:
I'm delving into using ADO.NET for the first time. In fact, I've never done any database work using C# at all so all of this is new to me. Please bear that in mind if I am asking stupid questions....
6
by: goodstart123 | last post by:
For example, the following code works fine without SqlConnection. Any Answer to the question? string connectionString = "server=YourServer; uid=sa; pwd=YourPassword;...
0
by: Seiche V via DotNetMonster.com | last post by:
hy. i want to fill a data table from a dataset using SqlDataAdapter.fill(myTable), but i get the error: System.NullReferenceException: Object reference not set to an instance of an object. ...
6
by: M | last post by:
Hi, Does SqlDataAdapter always close the connection (assuming connection was closed before calling Fill()), even if an exception occurs while calling Fill()? Example: try {...
7
by: Matt Jensen | last post by:
Howdy Fairly simple question I think, I presume the answer is no it can't be reused for 2 *SELECT* statements, but just hoping for clarification. Just asking in the interests of trying to minimise...
0
by: dakvanslam | last post by:
I apologize if this is a simple question, but I am very new to SQL Server. I feel like I am missing something easy here. I an running VB ..NET from Visual Studio 2005 and SQL Server Express. The...
8
by: Benniit | last post by:
Am using Vb.NET 2008 and SQL 2008. I have a problem, when the execution reaches daAdapter.Update(dtTable) then I receive this error ""String or binary data would be truncated. The statement has been...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.