I tried to connect to the mysql server via remote connection.
The connection string is server={IP};database={DB};uid={usernname};pwd={password};
try {
conn.Open();
sqlCmd = conn.CreateCommand();
sqlCmd.CommandText = sqlStr;
reader = sqlCmd.ExecuteReader(); //->LINE 32
while(reader.Read()) //Add to library
} catch (Exception ex) { }
finally {
//Close connection and reader
}
and i got this error.
08 June 2015 12:58:46 PM at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int64& insertedId)
at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int64& insertedId)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
at ProgramTest.Program.Main() in C:\Projects\ProgramTest\ProgramTest\Program.cs:line 32
I tried to connect using Mysql Workbench and success receiving results.
any code i missed that cause the problem?
thanks in advance!