PC Review


Reply
Thread Tools Rate Thread

CurrencyManager.AddNew problem

 
 
James Goodman
Guest
Posts: n/a
 
      6th Jun 2005
I am having a problem adding new records to a SQLCE table.

I have written my data-adapter insert command as appropriate.

I then added a 'new' button and added the following code to it:
Sub NewRecord()
Dim cMan as CurrencyManager
Dim dt as datatable = Nothing
dt = ds.Tables("tblName")
cMan = CType(Me.BindingContext(dt),CurrencyManager)
cMan.AddNew
End Sub

The user can select a record using a bound dropdown, and then fills in the
relevant data for a record using bound combo and textboxes.

When the above executes, a new line is inserted into the record selection
combo which is blank. It should be the int identity value from the
underlying table. I thought that doing this would move the current record to
the newly inserted record. However, it doesnt. If I attempt to save changes,
which calls the Data-Adapter.Update method, no errors are raised, but the
new record is not inserted.


Any suggestions what might be going wrong?


--
Cheers,

James Goodman


 
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
C# insertion of a record with CurrencyManager AddNew() method during the insertion of a father table record (with CurrencyManager AddNew() too) polocar Microsoft C# .NET 0 27th Sep 2006 06:51 PM
CurrencyManager.addnew Donald Microsoft ADO .NET 1 4th Jul 2005 02:49 PM
CurrencyManager.addnew Donald Microsoft Dot NET Framework Forms 1 4th Jul 2005 02:49 PM
CurrencyManager.AddNew - Cancel ?? a Microsoft Dot NET Framework Forms 3 12th May 2004 08:55 AM
Databindings on checkboxes - Currencymanager.AddNew Raymond Microsoft ADO .NET 2 3rd Oct 2003 07:44 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:46 AM.