Solved

Database does not save

Posted on 2006-07-02
2
175 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

830 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