Solved

Database does not save

Posted on 2006-07-02
2
178 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

617 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