Solved

Database does not save

Posted on 2006-07-02
2
174 Views
Last Modified: 2010-04-23
Hi
I am completely new to working with databases and would appreciate some help as this is driving me crazy.

I am using VB.net 2005 and have added a datasource (an existing Access database).
I have then dragged the datasource to a form and vb.net has added a datagridview and generated the following code

Public Class Form1

    Private Sub LicencesBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LicencesBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.LicencesBindingSource.EndEdit()
        Me.LicencesTableAdapter.Update(Me.LicencesDataSet.Licences)

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'LicencesDataSet.Licences' table. You can move, or remove it, as needed.
        Me.LicencesTableAdapter.Fill(Me.LicencesDataSet.Licences)

    End Sub
End Class

The problem is that LicencesBindingNavigatorSaveItem_Click does not save the changed data to the database.

All help much appreciated.

Best Regards
Alun Gwyther
0
Comment
Question by:alungwyther
2 Comments
 
LVL 34

Accepted Solution

by:
Sancler earned 500 total points
ID: 17029829
There is nothing on the face of the code you show, or in your description, which should stop the update occurring.  So have a look at this

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21896499.html#16967706

It covers one possibility.  If that is not the answer, can you come back with a bit more description about how you know that it "does not save the changed data to the database"?

Roger
0
 

Author Comment

by:alungwyther
ID: 17030553
That was it, many thanks.
I don't know how long it would have taken for me to figure that out.
Cheers
Alun
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now