SQL语句中含有乘号报错的处理办法
16lz
2022-01-09
在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语句
更多相关文章
- Android(安卓)报错:Caused by: android.os.FileUriExposedExcepti
- Ionic 运行报错No resource identifier found for attribute 'ap
- Android(安卓)启动Tomcat服务报错,端口占用解决方案
- Android(安卓)项目混编flutter报错
- Gradle Sync Failed,报错"could not find com.android.support:ap
- Android(安卓)报错 FLAG_ACTIVITY_NEW_TASK flag
- android 报错Attempt to invoke virtual method
- 关于android studio报错transformClassesAndResourcesWithProgua
- 报错android-apt plugin is incompatible with the Android(安卓