讲下思路,还是只能把表字段列出来,选择查询
可以字符串拼接
bool isfirst = true;
string sql = "select ";
foreach (CheckBox ch in this.FindControls.OfType<CheckBox>())
{
if (ch.Checked && isfirst)
{
sql += ch.Text;
isfirst = false;
}
else
{
sql += ", " + ch.Text;
}
}
sql = " from table where ...";
...