0

i have 2 tables in my database. i want to select data from one table and insert into the other. i have written my query using the the table adapter for that table. say i have a table named products and another named sales. using the salestableadapter i wrote and sql select statement to select data from product table and insert to the sales table like
INSERT INTO Sales
(productName, unitPrice )
SELECT productName, unitPrice
FROM Products
WHERE (ProductName = ?)
where productName is a parameter ie the product name the user will enter. this query is named InsertItem(ProductName).
I then add the 2 tables on my form and create a textbox named productNameTextBox and a button named addButton. on my addButtonClick_Event i call the insertItem query as follows

salesTableAdapter.InsertItem(databasenamedataset.Sales, productNameTextBox. Text)

But i keep on having an error saying no overloaded method for this function takes 2 parameters. i dont know how to sort it out. can you help pls

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by RwCC
0

I think you need to post some code so we can see what you are doing... like how you are instanciating InertItem.

--Jerry

0

Yes please post your code. Chances are you are having to insert values into all columns if they both have the same ones yet you are only inserting into 'x'

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.