我有这个sql命令:
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));
但结果不对。您是否知道如何在一个"变量"?
中插入更多值现在好了!感谢帮助。我的解决方案:
cmd = new SqlCommand("select code from table where stred in ("+ strediska +")",con);