Bilal Bilal - 3 years ago 151
SQL Question

Multiple Id's in In clause of SQL Query C#

I want to basically use multiple iD's in In clause of my sql query.
Now i have two options one is to get the comma separated ID's from a textbox or i can put a list view or grid view to insert id's there and then get the id's to be used in sql statement. Can you please help me with the code, how to do this thing?

Answer Source

In order to get textbox value you have to code like this:-

"select * from table where id in ( "+textbox1.text+")";
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download