Hello
using VB.NET I have the following simple code:
I know the mdf file exists
It keeps returning the following error against con.Open():
Could not use ''; file already in use.
Does anybody know why?
Thanks
Damian.
using VB.NET I have the following simple code:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim con As New OleDb.OleDbConnection()
Dim ds As New DataSet
Dim da As OleDb.OleDbDataAdapter
Dim sql As String
con.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source = C:\Test_SQL_Data.mdf"
con.Open()
sql = "SELECT * FROM Customers"
da = New OleDb.OleDbDataAdapter(sql, con)
MsgBox("A Connection to the Database is now open")
con.Close()
MsgBox("The Connection to the Database is now Closed")
End Sub
I know the mdf file exists
It keeps returning the following error against con.Open():
Could not use ''; file already in use.
Does anybody know why?
Thanks
Damian.