connect to mysql database with ADO.NET

djcybex

Member
Joined
Dec 17, 2002
Messages
10
i am desperate....

i connect to the database BUT when i want to read data i get errors like:
No error information available: DB_E_NOTABLE(0x80040E37).

anyway here is my code:
Code:
Dim SqlCMD As New OleDbCommand()
Dim strSql As String

Dim conString As String = "Provider=MySQLProv;Location=localhost;Data Source=mzp_sem;User Id=uid;Password=pass;"
Dim con As New OleDbConnection(conString)

If con.State = ConnectionState.Closed Then con.Open()
Console.WriteLine("Connection State:" & con.State.ToString)

SqlCMD.Connection = con
SqlCMD.CommandText = "SELECT * FROM foto ORDER BY id"

Dim MyDataReader As OleDbDataReader = SqlCMD.ExecuteReader here is error

While MyDataReader.Read
   MsgBox(MyDataReader("id"))
End While

any ideas?


ive tried also this code but produces same error:
Code:
Dim da As New System.Data.OleDb.OleDbDataAdapter("Select * from foto", con)
Dim ds As New DataSet()
da.Fill(ds, "foto") here is error

HELP!!! (or i will have to go back to COM ADO.... there it works)

thanks in advance!
Matej
 
Last edited by a moderator:
i found out that it doesnt support TEXT/BIGTEXT Type...
if i dont use this type i dont get the error but if i use it then i get that error

that error is for "table not found"

realy strange... but this means i cant use MySQL database...
damn.... i am so angry
 
aaaaaa THANX MAN!
i needed that HotFix ..... I told you that it was a bug :)

it works perfect now!!

thank you again
 
Back
Top