Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to search the database and update it on click of one button..
so we have to use multiple quries.. can anyone pls help me .. how to use multiple quries...
Posted

Update <some table name>
Set <col1> = <value1>
where <col2> = <search criteria1> AND <col3> = <search criteria2>

and so on....
 
Share this answer
 
v3


Not so sure how far I have got your problem.But if your search and update are related and part of a single button event, then you can rather go for creating a stored procedure.This will also give you the many advantages of using stored procedures.

If you are still reluctant to go for the stored procedures, you can write in your code-behind the two methods - one for Search and the other for Update.Whenever your Search criteria gets satisfied, give a call to Update, else not.And in Search and Update methods, write the one-line parametrized query to interact with the database.

HTH

Regards
Rajeev



Please vote and mark the answer as accepted if this helps you.


 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900