首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

问个简单有关问题,where link % % 里边格式不对,狂谢了~

2012-01-19 
问个简单问题,where link % % 里边格式不对,狂谢了~~~~~~~intad_nameint.Parse(DropDownList1.SelectedVa

问个简单问题,where link % % 里边格式不对,狂谢了~~~~~~~
int   ad_name   =   int.Parse(DropDownList1.SelectedValue);
int   ad_year   =   int.Parse(DropDownList2.SelectedValue);
int   ad_mothe   =   int.Parse(DropDownList3.SelectedValue);
int   ad_game   =   int.Parse(DropDownList4.SelectedValue);

where   a.AD_Name= '9 '   and   b.Visit_Date   like   %200705%   and   a.Game= '7 '

第一个问题:现在9和7的位置替换成相应的ad_name和ad_game
第二个问题:怎么把ad_year和ad_mothe加在一起放进%%里进行模糊查询???

就剩10分了,多谢


[解决办法]
1.where a.AD_Name= "+ ad_name + " and b.Visit_Date like %200705% and a.Game= "+ ad_game + "
[解决办法]
%200705% 改成  '%200705% '
[解决办法]
%200705% 改成  '%200705% '

[解决办法]
where a.AD_Name= ' "+ ad_name + " ' and a.Game= ' "+ ad_game + " ' and year(b.Visit_Date)= "+ ad_year + " and month(b.Visit_Date)= "+ ad_mothe + "

热点排行