Saturday, 14 September 2013

Visual C# 2010 Multiple lisbox choose

Visual C# 2010 Multiple lisbox choose

i have added 2 value in listbox as 1, it generates from MySQL code and
using While loop:
string name = myReader["name"].ToString();
string index = myReader["index"].ToString();
listBox1.Items.Add(index + " - " + name);
now im making a SELECT query with MySQL and i want to generate from
listbox, index which ill use in WHERE name = ..., i can use just string
name but when ppl have same name, it generates with errors so... example i
want to generate with index for no mistakes:
string query = "SELECT * FROM list WHERE index='" + listBox1.Text + "'";
but when it can`t choose only string index which added in top, it not
generates any name...
Finally my question is: how to force sql choose only index from listbox
when added 2 value as 1...
Thanks, hope i`ll get my answer

No comments:

Post a Comment