I seam to be having the same problem.
I added the the code that NetProgramer suggested but I wasn't successful.
My error is given at the While m_Dr.read
This is My code.
query = "Select * From " & Tabela & " where Model= @Model" & " Order by model asc"
Dim txtSource As String
Dim ObjFile As New System.IO.StreamReader("C:\CWDEsign\CWDEsign.txt")
txtSource = ObjFile.ReadToEnd()
ObjFile.Close()
ObjFile.Dispose()
Dim sourse As String = "Data Source=" & txtSource & ";"
Dim providr As String = "Provider=Microsoft.ACE.OLEDB.12.0;"
Dim MYcon = providr & sourse
Dim con = New OleDb.OleDbConnection(MYcon)
Dim cmd As New OleDb.OleDbCommand(query, con)
With cmd.Parameters
.AddWithValue("@Model", BModel)
End With
cmd.CommandType = CommandType.Text
cmd.CommandText = query
con.Open()
Dim m_dr As OleDbDataReader
m_dr = cmd.ExecuteReader
m_dt.Load(m_dr)
If (con.State = ConnectionState.Open) Then
con.Close()
End If
con.Open()
While m_dr.Read
ModelBuilder_Relation.Add(m_dr.GetString(0))
End While