Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 21st, 2005, 06:21 AM
Registered User
 
Join Date: Sep 2005
Location: Bucharest, , Romania.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataAdapter.Update acts strangely

Hi everyone.

I'm having a bit of a problem with the DataAdapter.Update method... I have a DataSet in which i modify some records but when i call the update method i get the DBConcurrencyException which says that there was nothing to modify (0 records affected by the update).
This is strange because i have verified that prior to calling the update method some records WERE modified and the correspondant rows had the RowState propery set to 'Modified'.

What could be the problem?
Thanks in advance.

Here are some details about how my program is actually working:

- i have a mainform (called MainForm) in which i added the connection to the database (it's a Access database with a single Table called Conturi), a dataadapter called DA_Conturi and a typed dataset (the class is called OPDataSet and the variable DS_Main)

- the table is DS_Main.Conturi and is also typed (OPDataSet.ConturiDataTable)

- i then have another form (a navigator) called ConturiNav to which i pass the table. the user accesses this form by a menu item in the MainForm called MI_Conturi

Here are the constructors for the two classes and the MI_Conturi_Click method which handles the click event on the menu item:

[MainForm.cs]
...
private System.Data.OleDb.OleDbDataAdapter DA_Conturi;
private OPDataSet DS_Main;
public MainForm()
{
    InitializeComponent();
    Conturi.Fill(DS_Main.Conturi);
}
...
private void MI_Conturi_Click(object sender, System.EventArgs e)
{
    ConturiNav cn=new ConturiNav(DS_Main.Conturi);
    cn.ShowDialog();
    cn.Dispose();
    DA_Conturi.Update(DS_Main.Conturi);
}

[ConturiNav.cs]
public OPDataSet.ConturiDataTable conturi;
public DataView dataview;
...
public ConturiNav(OPDataSet.ConturiDataTable conturi)
{
    InitializeComponent();
    this.conturi=conturi;
    dataview=new DataView(this.conturi);
    SometextBox.DataBindings.Add(new
          Binding("Text",dataview,"Somefield"));
        ...
}

the error appears when the users edits the text in 'Sometextbox' and then closes the ConturiNav form.


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
update dataadapter karenai Visual Basic 2005 Basics 0 February 9th, 2008 10:46 PM
DataAdapter.Update puzzle wirerider ASP.NET 2.0 Basics 1 August 1st, 2006 06:57 PM
Datagrid.update() and DataAdapter.Update aarunlal ASP.NET 2.0 Professional 2 February 23rd, 2006 11:41 PM



All times are GMT -4. The time now is 11:22 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.