主题:急,郁闷了我两整天的问题!
string idStr = Page.Request.QueryString["CardID"];
int idInt = Convert.ToInt32(idStr);
int curpage = Convert.ToInt32(this.labPage.Text);
PagedDataSource ps = new PagedDataSource();
sqlcon.Open();
//string sqlstr = "select * from CardInfo_View where CardID=";
string sqlstr = "select a.*,b.* from tb_Card as a inner join tb_RevertCard as b on a.CardID=b.CardID where a.CardID='"+idStr+"'";
//string sqlstr = "select a.*,b.* from tb_Card as a inner join tb_RevertCard as b on a.CardID=b.CardID where a.CardID=idInt";
OleDbDataAdapter MyAdapter = new OleDbDataAdapter(sqlstr, sqlcon);
DataSet ds = new DataSet();
MyAdapter.Fill(ds,"tb_Card");
sqlcon.Close();
数据库用的是ACESS,CardID用的是整型,SQL语句老是写不对
这种情况报错是System.Data.OleDb.OleDbException: 标准表达式中数据类型不匹配
大家帮帮忙这是怎么回事啊,该怎么写
我用注释中的也出错:至少有一个参数没有指定
int idInt = Convert.ToInt32(idStr);
int curpage = Convert.ToInt32(this.labPage.Text);
PagedDataSource ps = new PagedDataSource();
sqlcon.Open();
//string sqlstr = "select * from CardInfo_View where CardID=";
string sqlstr = "select a.*,b.* from tb_Card as a inner join tb_RevertCard as b on a.CardID=b.CardID where a.CardID='"+idStr+"'";
//string sqlstr = "select a.*,b.* from tb_Card as a inner join tb_RevertCard as b on a.CardID=b.CardID where a.CardID=idInt";
OleDbDataAdapter MyAdapter = new OleDbDataAdapter(sqlstr, sqlcon);
DataSet ds = new DataSet();
MyAdapter.Fill(ds,"tb_Card");
sqlcon.Close();
数据库用的是ACESS,CardID用的是整型,SQL语句老是写不对
这种情况报错是System.Data.OleDb.OleDbException: 标准表达式中数据类型不匹配
大家帮帮忙这是怎么回事啊,该怎么写
我用注释中的也出错:至少有一个参数没有指定