Running the following code, my program just will not get past the 'connection.Open()' line in this sub. I had a similar problem before where I was using a datareader when it was not needed, but in this sub I am not doing anything like that, merely opening a connection to the database. I can't figure out what I am doing wrong here, especially as there are no errors or anything.
Using connection As New OleDbConnection(connectionstring)
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)
Ah, I replaced the app.config file with a fresh one and the program now works perfectly fine once more. Thanks for your help!