Click here to Skip to main content
15,897,032 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi again
How to Dynamic search in C# with DataBase by textbox or comboBox?

Thanks
Posted

Use a query like
select * from table where my_column like 'yyy'

Here yyy will be the text that will be entered in the textbox.
 
Share this answer
 
Comments
FM7 27-Feb-12 8:28am    
thanks my friend
You can use SQL Wildcards
Wildcards
 
Share this answer
 
C#
ColCondition= comboBox4.Items[comboBox4.SelectedIndex].ToString();

ColCondition=textbox1.text.trim();

sqlstring = "select * from table where columnName = '" + ColCondition+ "' ;
 
Share this answer
 
v3

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