110,534
社区成员
发帖
与我相关
我的任务
分享
string sql = "select * from CusIf Where";
Dictionary<string, string> dt = new Dictionary<string, string>();
foreach(Control cl in this.groupPanel1.Controls)
{
if (cl is TextBox && cl.Text != string.Empty)
{
dt.Add( cl.Name.Replace("txt","Cus"),((TextBox)cl).Text.Trim());
}
}
int i = 0;
string sql2=null;
foreach (var v in dt)
{
sql += v.Key + "=" +"{"+i.ToString()+"}"+ "and";
i++;
}
sql2=string.Format(sql,....);//args