1

I have for example this sql command:

string strediska="0003,0005";
SqlCommand cmd = new SqlCommand();
            SqlConnection con = new SqlConnection("****");
            cmd = new SqlCommand("select code from table where stred in (@strediskac)", con);
            cmd.Parameters.Add(new SqlParameter("@strediskac", strediska));

But result is not right. Have you any idea how I could insert more values in one "variable"?

NOW its OK! Thanks for help. My solution:

cmd = new SqlCommand("select code from table where stred in ("+ strediska +")",con);
Robert
  • 10,403
  • 14
  • 67
  • 117
Kate
  • 372
  • 2
  • 11
  • 24

0 Answers0