Click here to Skip to main content
15,906,333 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

any one knows how to search multiple fields insql database table .

i have table like

string str2 = "select cld_id,cld_name,cld_adrs,cld_ctno,cld_cmdty,cld_tng,cld_state,cld_dst,cld_dof,cld_pby,cld_moc from coldstorage";

then i have checkbox list hear i have bind cld_name, dropdownlist hear i bind cld state and dropdown i bind cld_dst...

so now i want to select one or two ckeckboxes and i select state and distric

then i click searchbutton i want to show searching values in gridview

please give any idea how to search multiple fileds sqlquery

please any one helpm.
Posted

1 solution

SQL
SELECT * FROM MyTable WHERE columnA = 'value 1' AND columnB = 'value 2'


Read about WHERE clause:

http://www.w3schools.com/sql/sql_where.asp[^]
 
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