string sql="select numbers,leibie,title,datime from content order by datime DESC where leibie='会务活动'";
SqlCommand cmd=new SqlCommand(sql,con);
SqlDataAdapter sda=new SqlDataAdapter();
DataSet dset=new DataSet();
sda.SelectCommand=cmd;
sda.Fill(dset,"content");
this.DataGridhwhd.DataKeyField="numbers";
this.DataGridhwhd.DataSource=dset.Tables["content"];
this.DataGridhwhd.DataBind(); 运行时总是提示sql在where附近有语法错误 ?
SqlCommand cmd=new SqlCommand(sql,con);
SqlDataAdapter sda=new SqlDataAdapter();
DataSet dset=new DataSet();
sda.SelectCommand=cmd;
sda.Fill(dset,"content");
this.DataGridhwhd.DataKeyField="numbers";
this.DataGridhwhd.DataSource=dset.Tables["content"];
this.DataGridhwhd.DataBind(); 运行时总是提示sql在where附近有语法错误 ?
解决方案 »
- 获取本行行数的问题
- 用Filter过滤时出现Type mismatch in expression这样的问题,请教各位!
- 今天遇到一个怪问题,不知是为什么?
- C# 怎样链接数据库啊!!哪位大哥给哥例子啊啊!!谢谢;了啊!!!!!
- 如果不学习API,直接学.NET framwork如何啊?
- XML样式表问题 请前辈帮忙!
- 关于OracleClient中处理CLOB的问题(C#)
- 程序"F:\csharp\windowsapplication1\obj|debug\windowsapplication1.exe"未定義入口點
- ~~~~!!!!今天的面试C#题目 要我做一个具体东西出来 大家进来看看!!!!!
- 怎样修改dataTable中符合条件的数据?急
- OPC Client 用C#写。
- 谁了解coreports
string sql="select numbers,leibie,title,datime from content where leibie='会务活动' order by datime DESC ";
应放在最后~~
语句顺序错了!
这样写