OleDbException未处理 - 不是有效的文件名

时间:2016-04-20 22:13:47

标签: c# ms-access database-connection oledbconnection

我尝试在MS Access数据库和我的c#应用程序之间建立连接,但我不明白为什么在文件名正确时出现此错误。

enter image description here

任何

    private void Form1_Load(object sender, EventArgs e)
    {
        // TODO: This line of code loads data into the 'sQTDBDataSet.tblEquipment' table. You can move, or remove it, as needed.
        this.tblEquipmentTableAdapter.Fill(this.sQTDBDataSet.tblEquipment);
        OleDbConnection connection = new OleDbConnection();
        connection.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=‪C:\Users\Owner\Documents\Visual Studio 2015\Projects\Application\Application\bin\Debug\SQTDB.accdb;Persist Security Info=False;";
        connection.Open();
        checkConnectionLabel.Text = "Connected.";
        connection.Close();
    }

0 个答案:

没有答案