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!!!!!
Re: How to implement an insert update delete query
Can you post your code block for "SaveCustomer()"? Please use [CODE] blocks to preserve formatting.