2 w341321471 w341321471 于 2014.04.15 09:19 提问

刚解除 请求大神解答下呗 谢谢

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.OleDConnection;

namespace personManagement
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}

    private void Form3_Load(object sender, EventArgs e)
    {
        this.Text = "删除员工信息";
        label1.Text = "请输入所要删除的名字:";
        label1.AutoSize = true;
        textBox1.Text = "";
        button1.Text = "删除";
        button2.Text = "取消";

    }

    private void button2_Click(object sender, EventArgs e)
    {
        this.Close();

    }

    private string myConnectionString =

@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\ygxxb.accdb";
private int myExecuteNoQuery(string sql)
{
OleDbConnection cnn = new OleDbConnection(myConnectionString);
cnn.Open();
OleDbCommand cmd = new OleDbCommand(sql, cnn);
cmd.CommandType = CommandType.Text;
int i = cmd.ExecuteNonQuery();
cnn.Close();
return i;
}

    private void button1_Click(object sender, EventArgs e)
    {
        string sql = string.Format
    ("delete from person where 姓名 = '{0}'", textBox1.Text);
        int flag = myExecuteNoQuery(sql);
        if (flag > 0)
            MessageBox.Show("删除记录成功!", "删除员工提示");
        else
            MessageBox.Show("删除记录失败!", "删除员工提示"); 

    }
}

}
命名空间“System”中不存在类型或命名空间名称“OleDConnection”(是缺少程序集引用吗?)

请问 这个怎么修改呢 刚开始学 到这里 不能调式了 老师报错

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!