string strSQL="Select * From Product Where Category='"+ System.Web.HttpContext.Current.Request.QueryString["Category"].toString().Trim()+"' order by ProductID DESC";
...
Request.QueryString["Category"].Trim().ToString+"order by ProductID DESC";
...
也就是把这句改成下面的样子看看行不呢?即在 "和order之间加一个空格.
...
Request.QueryString["Category"].Trim().ToString+" order by ProductID DESC";
...
LZ改成这样看看行不行:
public OleDbDataReader ProductList()
{
myConnection=new OleDbConnection(ConfigurationSettings.AppSettings["ConnectionString"]+System.Web.HttpContext.Current.Server.MapPath("yuelong.mdb"));
string strSQL="Select * From Product Where Category="+ System.Web.HttpContext.Current.Request.QueryString["Category"].Trim().ToString+" order by ProductID DESC"; //这里多加一个空格,也就是+" order by ProductID DESC",
OleDbCommand myCommand=new OleDbCommand(strSQL,myConnection);
public OleDbDataReader ProductList()
{
myConnection=new OleDbConnection(ConfigurationSettings.AppSettings["ConnectionString"]+System.Web.HttpContext.Current.Server.MapPath("yuelong.mdb"));
string strSQL="Select * From Product Where Category="+ System.Web.HttpContext.Current.Request.QueryString["Category"].Trim().ToString+"order by ProductID DESC";
OleDbCommand myCommand=new OleDbCommand(strSQL,myConnection);