?
Solved

cannot update the actual database

Posted on 2007-11-18
6
Medium Priority
?
175 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
[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
  • 3
  • 3
6 Comments
 
LVL 63

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 63

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
Setting up LaraDock for Laravel

Learn how to set up LaraDock in a Laravel project - LaraDock gives us an easy way to run a Laravel application using Docker in a single command.

 

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 63

Accepted Solution

by:
Fernando Soto earned 2000 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

752 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