1 Replies - 1795 Views - Last Post: 05 September 2011 - 12:00 PM Rate Topic: -----

#1 Richy15   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 25-July 11

[Question] How to save data in DB?

Posted 05 September 2011 - 08:28 AM


I have a db created in MS Access 2007. I have the table like this, for example:

FirstName | LastName | Email |
John | Einstein | [email protected]|

I am trying to add/delete/modify/etc data in it using an application in VB.NET that I am creating. The problem is that I can't (or I don't know) save the data that I want to add/delete/etc. I mention that I don't load it programatically. I loaded with a DataGridView, DataSet, BindingSource and TableAdapter. How can I update/save the data in the db permanently?

Here is some code where I am trying to add data (this code is just for test):

Private sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Db_testDataSet.Customers.AddCustomersRow(TextBox1.Text, TextBox3.Text, TextBox2.Text, ComboBox1.Text)
            Label3.Text = "Saved successfully!"
        Catch ex As Exception
            MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error!")
     End Try
End Sub


Is This A Good Question/Topic? 0
  • +

Replies To: [Question] How to save data in DB?

#2 tlhIn`toq   User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6532
  • View blog
  • Posts: 14,447
  • Joined: 02-June 10

Re: [Question] How to save data in DB?

Posted 05 September 2011 - 12:00 PM

We have an entire tutorials section just for databases. Have you checked it out and done some of them?

See FAQ #24 for database questions

FAQ (Frequently Asked Questions - Updated Aug 2011


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1