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

怎么在SQL查询语句中加入VB里的某控件或者某变量

2012-07-18 
如何在SQL查询语句中加入VB里的某控件或者某变量。如:VB.NET codea 3GridView1.DataSource sdb.get_dat

如何在SQL查询语句中加入VB里的某控件或者某变量。
如:

VB.NET code
  a = 3   GridView1.DataSource = sdb.get_dataset("select top a name as 姓名 ,                                          max(case subject when '语文' then grade else 0 end) 语文,                                          max(case subject when '数学' then grade else 0 end) 数学,                                          max(case subject when '英语' then grade else 0 end) 英语                                           from grades group by name")   GridView1.DataBind()

  这么写肯定是错的 SQL哪里知道a=3 
求高手指教

[解决办法]
int i = 10;
"select top"+ i.ToString()

热点排行