Solved

cannot update the actual database

Posted on 2007-11-18
6
171 Views
Last Modified: 2013-11-26
I am having issues with a visual basic project. I am working on a sql express database. I am having the form auto generate the dataset from the database and auto setting the table adapters for me. My problem is inserting/updating the actual database. Using Form1.CUSTOMERTableAdapter.Insert (blah blah) I am able to update the dataset, but I do not know how to make it update the actual database with the new information. Any help would be appreciated.
0
Comment
Question by:rolltide0
  • 3
  • 3
6 Comments
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 20309186
Hi rolltide0;

To update the database use the SQLDataAdapter's Update method as shown below.

Form1.CUSTOMERTableAdapter.Update()

Fernando
0
 

Author Comment

by:rolltide0
ID: 20309294
I tried that and it didnt work. It said there was no Update method that accepted zero arguments. I included the code from the sub for reference. As mentioned before, it will update the dataset, but not the actual database.
Private Sub updateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles updateButton.Click
        Dim TypeValue As String
        If individualButton.Checked Then TypeValue = "IND" Else TypeValue = "BUS"
 
        Form1.CUSTOMERTableAdapter.Insert(CusNumField.Text, LastNameField.Text, FirstNameField.Text, MiField.Text, Addr1Field.Text, CityField.Text, StateField.Text, ZipField.Text, HomePhoneField.Text, CellPhoneField.Text, WorkPhoneField.Text, TypeValue, Addr2Field.Text)
 
 
        updateButton.Enabled = False
 
 
 
 
 
    End Sub

Open in new window

0
 
LVL 62

Expert Comment

by:Fernando Soto
ID: 20309801
I am learning working with database myself now. When you auto generate your SqlDataAdapter you need to configure it. This will create the Insert, Delete from the SQL Select statement which you create during the configuration set-up. If you right click on the SqlDataAdapter there should be a menu item to configure it. Follow the wizard.
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

Author Comment

by:rolltide0
ID: 20320316
I have a dataset, binding source, table adapter, and navigator. None of them have a config wizard. There is a query builder, is that what you are referring to? If not please explain.
0
 
LVL 62

Accepted Solution

by:
Fernando Soto earned 500 total points
ID: 20320820
Look at these two web pages on configuring the TableAdapter.

TableAdapter Overview  
http://msdn2.microsoft.com/en-us/library/bz9tthwx(VS.80).aspx

TableAdapter Configuration Wizard  
http://msdn2.microsoft.com/en-us/library/dex7k4dw(VS.80).aspx
0
 

Author Closing Comment

by:rolltide0
ID: 31409838
Even though this wasn't the exact fix to my problem it led me to the problem. There was  a problem accessing my sql express file, so I imported the database to a full version of sql server 2005. Then I created a login and pointed the project to that database. Been working ever since.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

805 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