protected void BindData(string where)
{
int count = 0;
string strSql = "select count(1) from ibt1 T0 left join oitm T2 ON T2.itemcode=T0.itemcode left join owtr T3 ON T3.DocNum=T0.BaseEntry left join oibt T4 ON T4.ItemCode=T0.ItemCode" + where;
DataSet ds = new DataSet();
ds = WangWei.DBUtility.DbHelperSQLSAP.Query(strSql); count = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString());
ds = WangWei.DBUtility.DbHelperSQLSAP.GetListPage(" select T0.itemcode ,T0.itemName ,T2.FrgnName ,T2.SuppcatNum ,T0.Quantity,T0.BatchNum , T4.PrdDate ,T4.ExpDate ,T0.Whscode,T0.BaseEntry,T0.Direction,T0.DocDate from ibt1 T0 left join oitm T2 ON T2.itemcode=T0.itemcode left join owtr T3 ON T3.DocNum=T0.BaseEntry left join oibt T4 ON T4.ItemCode=T0.ItemCode and T4.Whscode=T0.Whscode and T4.BatchNum=T0.BatchNum where T0.Direction='0' and T0.whscode<>'01' and T3.Filler='01' order by T0.BaseEntry ,T0.itemcode asc "
+ where, pager.CurrentPageIndex, pager.PageSize, "itemcode ", "itemcode asc");
{
int count = 0;
string strSql = "select count(1) from ibt1 T0 left join oitm T2 ON T2.itemcode=T0.itemcode left join owtr T3 ON T3.DocNum=T0.BaseEntry left join oibt T4 ON T4.ItemCode=T0.ItemCode" + where;
DataSet ds = new DataSet();
ds = WangWei.DBUtility.DbHelperSQLSAP.Query(strSql); count = Convert.ToInt32(ds.Tables[0].Rows[0][0].ToString());
ds = WangWei.DBUtility.DbHelperSQLSAP.GetListPage(" select T0.itemcode ,T0.itemName ,T2.FrgnName ,T2.SuppcatNum ,T0.Quantity,T0.BatchNum , T4.PrdDate ,T4.ExpDate ,T0.Whscode,T0.BaseEntry,T0.Direction,T0.DocDate from ibt1 T0 left join oitm T2 ON T2.itemcode=T0.itemcode left join owtr T3 ON T3.DocNum=T0.BaseEntry left join oibt T4 ON T4.ItemCode=T0.ItemCode and T4.Whscode=T0.Whscode and T4.BatchNum=T0.BatchNum where T0.Direction='0' and T0.whscode<>'01' and T3.Filler='01' order by T0.BaseEntry ,T0.itemcode asc "
+ where, pager.CurrentPageIndex, pager.PageSize, "itemcode ", "itemcode asc");
解决方案 »
- 为什么用UpdatePanel把控件围起来了还会出现刷新?
- 怎样把button控件定义成一张图片?或者用css改变他的样式?
- 用FreeTextBox编辑ASPX页的时候页面里有iframe,编辑框里自动执行iframe里的文件了,导致出错
- 请大家推荐“开发Web服务器控件”方面的文章,多谢!
- 最有可能的"System.UnauthorizedAccessException"异常出现在mscorlib.dll中 其他信息:对路径ua9ph3uy.dll的访问被拒绝
- 数据库连接问题
- 老问题:treeview怎么使用啊?
- 各位专家们快来看这个图片上传的超难问题,急!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- 大家关注一下,datagrid显示的换行问题?
- 关于ASP.NET中关键词大小写的问题!
- 求从网页下载并注册ActiveX控件的代码及详细部署流程(HTM,ASP都行)
- VS2005与IIS有啥关系?
建议在执行sql的语句上下断点,查看执行的sql是否确实正确,必要的时候把将在程序里执行的sql语句复制到Sql查询分析器或者SQL Server Management Studio Express里面执行看看。string strSql = "select count(1) from ibt1 T0 left join oitm T2 ON T2.itemcode=T0.itemcode left join owtr T3 ON T3.DocNum=T0.BaseEntry left join oibt T4 ON T4.ItemCode=T0.ItemCode" + where;
这样构造出来的sql语句很可能出错,因为你无法保证字符串where的前面有空格。
"and T3.Filler='01'" +where+" order by T0.BaseEntry ,T0.itemcode asc "
where T0.Direction='0' and T0.whscode<>'01' and T3.Filler='01' order by T0.BaseEntry ,T0.itemcode asc "+ where,