打开 Oledb 连接时代码停止

Code Stopping when Opening an Oledbconnection

运行 下面的代码,我的程序只是不会通过这个子中的 'connection.Open()' 行。在不需要数据读取器时我曾遇到过类似的问题,但在这个子程序中我没有做任何类似的事情,只是打开与数据库的连接。我不知道我在这里做错了什么,特别是因为没有错误或任何东西。

Using connection As New OleDbConnection(connectionstring)
    connection.Open()

    Dim Command As New OleDbCommand("SELECT SUM(Price) FROM ItemsSold", conection)
    Dim Command2 As New OleDbCommand("SELECT SUM(TotalCost) FROM Inventory", connection)
    Dim Turnover As Double = Convert.ToDouble(Command.ExecuteScalar())
    Dim Cost As Double = Convert.ToDouble(Command2.ExecuteScalar())

    lblProfit.Text = "Profit: £" & (Turnover - Cost)

    connection.Close()
End Using

啊,我用一个新的文件替换了 app.config 文件,程序现在再次完美运行。感谢您的帮助!