在ADO中,我们需要在SQL语句中使用乘法运算,可是添加'*'以后执行程序总是会出错,这是因为‘*'与sql中的‘*'关键字重合了,所以编译会出错。

解决办法:将乘法运算放到sql语句外面,将结果放入一个变量中,然后在sql语句中引用即可

int count = (this.AspNetPager1.CurrentPageIndex-1)*this.AspNetPager1.PageSize;string sql = " select top "+count+" E_Id from Emp order by E_Id asc";//自定义的SQL语句

更多相关文章

  1. Android(安卓)报错:Caused by: android.os.FileUriExposedExcepti
  2. Ionic 运行报错No resource identifier found for attribute 'ap
  3. Android(安卓)启动Tomcat服务报错,端口占用解决方案
  4. Android(安卓)项目混编flutter报错
  5. Gradle Sync Failed,报错"could not find com.android.support:ap
  6. Android(安卓)报错 FLAG_ACTIVITY_NEW_TASK flag
  7. android 报错Attempt to invoke virtual method
  8. 关于android studio报错transformClassesAndResourcesWithProgua
  9. 报错android-apt plugin is incompatible with the Android(安卓

随机推荐

  1. Android 控件的显示隐藏上下左右移动动画
  2. Android复制粘贴到剪贴板
  3. Android(安卓)API 28 使用 android-async
  4. Android Wear Preview- 从通知上接收语音
  5. Android 开源框架的收集
  6. 网络书签about Android
  7. Android UI详解之动态布局
  8. android aidl通讯两个APP之间的应用
  9. android读写文件
  10. C# mono android 图片上传进度条实现