Results 1 to 2 of 2

Thread: How to implement an insert update delete query

  1. #1

    Thread Starter
    Member
    Join Date
    May 2008
    Posts
    48

    How to implement an insert update delete query

    hey,
    i have just made an insert query

    INSERT INTO Customer
    (Firstname, Lastname, Address, Postalcode, Phone, City, CheckedID, NormalAccount, StandardAccount)
    VALUES (@Firstname,@Lastname,@Address,@Postalcode,@Phone,@City,@CheckedID,@NormalAccount,@StandardAccount);
    SELECT CustomerID, Firstname, Lastname, Address, Postalcode, Phone, City, CheckedID, NormalAccount, StandardAccount FROM Customer WHERE (CustomerID = SCOPE_IDENTITY())

    now i would appreciate some help on how to get it to work on the form i have created, what is the code that i should use to try and make this query work,
    i tried using
    Try
    Me.Validate()
    Me.CustomerBindingSource.EndEdit()
    Me.TableAdapterManager.UpdateAll(Me.LibraryDatabaseDataSet)
    Me.CustomerTableAdapter.insertquery(Me.LibraryDatabaseDataSet.Customer)

    MsgBox("Update Successful")
    Catch ex As Exception

    MsgBox("Update failed")
    End Try

    but i get errors!! like this one below

    Argument not specified for parameter 'City' of 'Public Overridable Overloads Function insertquery(Firstname As String, Lastname As String, Address As String, Postalcode As Decimal, Phone As Decimal, City As String, CheckedID As Integer?, NormalAccount As Integer?, StandardAccount As Integer?) As Integer'.

    SOMEONE PLEASE HELP!!!!!
    Last edited by tgore555; May 16th, 2008 at 01:01 PM.

  2. #2
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    Re: How to implement an insert update delete query

    Can you post your code block for "SaveCustomer()"? Please use [CODE] blocks to preserve formatting.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width