Click here to Skip to main content
15,917,652 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to set query in c#.

C#
("SELECT  * FROM Purchase where ItemID=' + SELECT  ItemID FROM ItemMaster where ItemName='" + DropDownList3.SelectedItem.Text + '"'"   and CategoryID='" + SELECT  CategoryID FROM ItemMaster where ItemName=' "+ DropDownList3.SelectedItem.Text + '"' ", con);
Posted
Updated 28-Nov-11 22:58pm
v2
Comments
RaisKazi 29-Nov-11 4:58am    
Edited: Added "pre" tag.

1 solution

try like this...

C#
string strQuery = "SELECT * FROM Purchase where ItemID=(SELECT ItemID FROM ItemMaster where ItemName='" +  DropDownList3.SelectedItem.Text + '" and CategoryID=(SELECT CategoryID FROM ItemMaster where ItemName='"+ DropDownList3.SelectedItem.Text + '")"; 
 
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