Solved

cannot update the actual database

Posted on 2007-11-18
6
169 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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 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

19 Experts available now in Live!

Get 1:1 Help Now