Description: An unhandled exception occurred during
the execution of the current web request. Please review the stack trace
for more information about the error and where it originated in the
code.
Exception Details: System.Data.SqlClient.SqlException: Conversion failed when converting the varchar value 'Retail' to data type int.
Source Error:
Line 66: curpage = 1;
Line 67: }Line 68: Products = productBLL.GetDistributorViewList(out record, curpage, pagesize, "ProductAgentId Desc", where);Line 69:
Line 70: if (Products == null)
最佳解决方案
可以打印出SQL语句,对比数据库字段类型和条件参数类型。根据数据库字段类型,程序里面转换好后再传递给数据库执行查询