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

Recommended Answers

All 2 Replies

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

--Jerry

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'

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.