Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C# (http://www.go4expert.com/forums/c-sharp/)
-   -   Need help perfoming actions on the result of a query (http://www.go4expert.com/forums/help-perfoming-actions-result-query-t16221/)

theCrave 17Feb2009 05:28

Need help perfoming actions on the result of a query
 
I am building an application that will keep track of items. Users will be allowed to insert data into an access database, and they will also be able to edit and return query results from this database.

Currently I have brought in the oledb class, set up forms to enter information into the database. Using oledbcommand and execute.nonquery I am able to enter the input into the database with no problem. I am also able to write a query and display it in my datagridview.

My problem is this. I need to query my db using user input, and then use these results to do further actions. For example I would like to do something along these lines:

SELECT TOP "variable" field1, field2, field3
FROM table1
WHERE field3="A"

Up to here I'm fine, I can write this and make it work. But, now I want to be able to use the results returned from above and do something like:

INSERT INTO table1(field4) VALUES ('S');
&
SELECT field1, field2, SUM(field3) AS SumOfField3
FROM table1
GROUP BY field2, field1 --> Again I want to use the results from the first query, and I also want to make SUM(field3)'s value available to the user.

Thanks for any help

xpi0t0s 17Feb2009 16:28

Re: Need help perfoming actions on the result of a query
 
What database are you using?

expvice 4Mar2009 13:34

Re: Need help perfoming actions on the result of a query
 
Your questions is complex, and also we need detail information about your question so we are online at that link, just reach us to get answer
<<Snipped>>


All times are GMT +5.5. The time now is 01:38.