标准表达式中数据类型不匹配。
运行的时候总是提示 标准表达式中数据类型不匹配。是怎么回事啊?using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string conString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=";
conString += Server.MapPath(@"./App_Data/IP.mdb");
OleDbConnection c = new OleDbConnection(conString);
c.Open();
string a = this.DropDownList1.Text;
string b = this.TextBox1.Text;
OleDbCommand thisCmd = c.CreateCommand();
= "SELECT * FROM ipManage WHERE (" + a + "=" + b + ")";
OleDbDataAdapter ad = new OleDbDataAdapter(thisCmd);
DataSet ds = new DataSet();
ad.Fill(ds, "ipManage");
GridView1.DataSource = ds.Tables[0].DefaultView;
GridView1.DataBind();
}
}