| | |
problem with update in dataset
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2006
Posts: 14
Reputation:
Solved Threads: 0
Hi there,
i'm working on a project in which i'm creating, editing and deleting customer records from a MS access db. I'm using vb.net 2003.
As with creating and deleting records i dont have any probelms. the problems arise when i come to update the data base if i edit any details. when i debugged it it showed the changes but not in the database. below is the code i used :
it's not giving me any errors. any help please very much appreciated
thank you very much
Luke
i'm working on a project in which i'm creating, editing and deleting customer records from a MS access db. I'm using vb.net 2003.
As with creating and deleting records i dont have any probelms. the problems arise when i come to update the data base if i edit any details. when i debugged it it showed the changes but not in the database. below is the code i used :
PrivateSub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click MsgBox("Do you want to save to database?", MsgBoxStyle.YesNo) If MsgBoxResult.Yes Then Dim custrow As DataSet1.CustomerRow custrow = DataSet11.Customer.FindByCust_id(lblCustNo.Text) custrow.BeginEdit() custrow.Cust_Address = txtAdd.Text custrow.Cust_email = txtEmail.Text 'custrow.Cust_id = lblCustNo.Text custrow.Cust_name = txtName.Text custrow.Cust_Sname = txtSname.Text custrow.Cust_Tel = txtTel.Text custrow.EndEdit() custrow.AcceptChanges() Me.oledb_cust_edit.Update(Me.DataSet11) Me.OleDbConnection1.Close() End If Me.oledb_cust_edit.Fill(DataSet11) interfaces.form2.Show() interfaces.form4.Hide() End Sub
it's not giving me any errors. any help please very much appreciated
thank you very much
Luke
•
•
•
•
custrow.AcceptChanges()
Me.oledb_cust_edit.Update(Me.DataSet11)
after calling AcceptChanges the RowState property of custrow will be set to Unchanged so Me.oledb_cust_edit.Update(Me.DataSet11) will return NO change to the dataset
to solve this just inverse the two lines
VB.NET Syntax (Toggle Plain Text)
Me.oledb_cust_edit.Update(Me.DataSet11) custrow.AcceptChanges()
Last edited by manal; May 16th, 2007 at 12:29 am.
"give only what u willing to receive "
![]() |
Similar Threads
- Problem with Windows Update and WinXP (Web Browsers)
- delete a record and update the dataset (VB.NET)
- Having problems with adding a row to a DataSet (VB.NET)
- Firefox problem - can't install update and Thunderbird -"fights" with Netscape! (Windows NT / 2000 / XP)
- Windows Update Problem (Windows NT / 2000 / XP)
- Norton Internet Security 2004 Live Update (Viruses, Spyware and other Nasties)
Other Threads in the VB.NET Forum
- Previous Thread: creating array for saving location of label
- Next Thread: link two menus
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2008 access add advanced application array assignment basic beginner box browser button buttons center click client code combo convert cpu cuesent data database datagrid datagridview datetimepicker designer dissertation dissertations dissertationtopic eclipse editvb.net employees excel exists forms function html images isnumericfuntioncall lib listview map mobile module msaccess mssqlbackend mysql net number open page pan pdf picturebox picturebox2 port print printing printpreview problem record regex reuse right-to-left save search serial settings socket sorting sqldatbase sqlserver storedprocedure structures temp textbox timer timespan transparency txttoxmlconverter usercontol vb vb.net vb2008 vba vbnet vista visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winsock wpf wrapingcode xml





