取得数据库中数据 查询条件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);

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

posted @ 2014-11-28 11:49  xzh1993  阅读(424)  评论(0编辑  收藏  举报