473,402 Members | 2,061 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,402 software developers and data experts.

Need help with C# DataSets

I'm got strange behaviour calling AcceptChanges when initialising my
DataSet.

Before calling the EndInit() method when initialising a DataSet
(auto-generated), I initialise 2 static tables within the DataSet
(table data doesn't change at runtime). The first table is loaded by a
table adapter which makes the DataSet indicate no changed rows.
However, loading the second table manually makes the DataSet indicate
changed rows; so I call AcceptChanges() which fixes the problem. After
that I setup event handlers for RowChanged and ColumnChanged, and then
call EndInit() for the DataSet.

Now the fun starts. I load the form, load the dataset with the data to
edit, set the BindingSource, which all controls on the form are bound
to, and start editing. The event handlers which were setup earlier
never get called with AcceptChanges(). If I remove the AcceptChanges()
line when initialising the database, the row and column change events
get fired off.

Can someone please explain what's going wrong?

Dale.

Sep 11 '06 #1
4 3654
Are you calling AcceptChanges() after you send an update back through
the DataAdapter?.

Dale wrote:
I'm got strange behaviour calling AcceptChanges when initialising my
DataSet.

Before calling the EndInit() method when initialising a DataSet
(auto-generated), I initialise 2 static tables within the DataSet
(table data doesn't change at runtime). The first table is loaded by a
table adapter which makes the DataSet indicate no changed rows.
However, loading the second table manually makes the DataSet indicate
changed rows; so I call AcceptChanges() which fixes the problem. After
that I setup event handlers for RowChanged and ColumnChanged, and then
call EndInit() for the DataSet.

Now the fun starts. I load the form, load the dataset with the data to
edit, set the BindingSource, which all controls on the form are bound
to, and start editing. The event handlers which were setup earlier
never get called with AcceptChanges(). If I remove the AcceptChanges()
line when initialising the database, the row and column change events
get fired off.

Can someone please explain what's going wrong?

Dale.
Sep 11 '06 #2
No, I'm not calling AcceptChanges() after updating through a DataAdapter.
I just populating a table with about 5 rows of static data. I then call
AcceptChanges() so that the DataSet doesn't report any changes made.
"Storm! Sams" <St***********@gmail.comwrote in message
news:11********************@b28g2000cwb.googlegrou ps.com...
Are you calling AcceptChanges() after you send an update back through
the DataAdapter?.

Sep 13 '06 #3
Sorry, I hadn't tracked the problem far enough.

I've found that, yes, my column change event handler does get called. The
only problem is that when I inspect the event arguments, I find that the row
being modified has it's RowState set as unchanged. I presume this is my
problem and how I can fix it.

Regards,

Dale Harris.
Sep 13 '06 #4
I'm going to repost this as "RowState not updating"
Sep 13 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Brian Kiser | last post by:
What is Microsoft's stance on developing business objects vs datasets when creating n-tier apps. Is anyone doing business objects? It appears that most articles from MS recommend passing...
2
by: malcolm | last post by:
Hello, We have a robust (.NET 1.1 c# winforms) client-server application that utilizes many typed DataSets, typed DataTables and typed DataRows. Our application is a series of windows and popup...
2
by: Elliot Rodriguez | last post by:
As I continue to read more about the benefits of database querying using ADO.NET, I am having a more difficult time distinguishing what the best approach to data retrieval is anymore. When...
30
by: nephish | last post by:
Hey there, i have tried about every graphing package for python i can get to work on my system. gnuplot, pychart, biggles, gdchart, etc.. (cant get matplot to work) so far, they all are working...
0
by: Bj?rn Mor?n | last post by:
I am consuming a web service that returns arrays of classes which can contain other classes (a hierarchy of data). Is there a simple way to move the data into a typed DataSet without writing too...
2
by: Dan Cooper | last post by:
I've got two datasets, each containing a single data table. dstDataSetA.Tables("TableA") dstDataSetB.Tables("TableB") I want to merge them together and delete any non-matching rows. ...
3
by: Shapper | last post by:
Hello, Until now I have been using Dreamweaver to create ASP.Net/VB web sites. I gave up of using it. Too many limitations. What is the best software to create ASP.NET/VB web sites? Maybe...
3
by: LW | last post by:
Hi! I am getting the following error message for my fairly simple web service. I have classes and have two DataSets that reference the same classes. The error is: The XML element named...
0
by: S.Tedeschi | last post by:
Hi all; as posted some days ago, I'm converting an on-line app; I used to heavily rely on strongly-typed DataSets directly dropped onto pages, and so viewed by code(-behind) as well. In the next...
9
by: gardnern | last post by:
We have X number of data sets, of Y length each. For example... Small, Medium, Large and Red, Green, Blue, Yellow We need to generate a list of all possibilities Small Red
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.