我是新来地 请大家帮帮我吧!!!
protected void LinkButton2_Click(object sender, EventArgs e)
{
string newsID = this.Label1.Text;
OleDbConnection myconn = DB.CreateConnection();
myconn.Open();
string sql = "delete from news where ID='" + newsID + "'";
OleDbCommand cmd = new OleDbCommand(sql, myconn);
cmd.ExecuteNonQuery();
}
当点击删除按钮执行这段程序时却提示“标准表达式中数据类型不匹配。”感觉好像是那个“newsID”和我的数据库里的ID类型不匹配,我试过很多方法都不好用,该如何解决?多谢!!!