取得数据库中数据 查询条件where使用规则

string where = string.Format("DnX < {0} and DnD > {0} and Types = '{1}' and Type1 = '{2}' and Type2 = '{3}' and Baojiao = {4} and HasPad = {5}"
, DI, cbTypes.Text, cbType1.Text, cbType2.Text, double.Parse(cbBaojiao.Text),ccbPad.Checked);

字符串要带‘’号 不带引号的类型要转化 

原文地址:https://www.cnblogs.com/xzh1993/p/4128167.html