读书人

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

发布时间: 2012-07-18 12:05:41 作者: rapoo

如何在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()

读书人网 >VB Dotnet

热点推荐