Parameters are marked now with ?, not with @. If you need to keep using
the @, then you need to add "old syntax=yes" to your connection string.
Klaus Prückl wrote:
>after the collation problems with Connector .NET 1.0.1 I'm still having trouble
> getting data from a 4.1.7 database (default charset: latin1) with version 1.0.2:
>My problem is, that I'm never getting a row (without errors). With ByteFX 0.76 the
> same source is working:
>string sql = "SELECT ID, Name, Password FROM Users WHERE Name = @Name AND Password =
>MySqlConnection connection = new MySqlConnection (
> "server=localhost;database=mydb;User Id=user;Password=xxxx" );
>IDbCommand command = connection.CreateCommand();
>command.CommandText = sql;
>command.CommandType = CommandType.Text;
>MySqlParameter p1 = new MySqlParameter();
>p1.DbType = DbType.String;
>p1.Direction = ParameterDirection.Input;
>p1.ParameterName = "@Name";
>p1.Size = 50;
>p1.Value = "username";
>MySqlParameter p2 = new MySqlParameter();
>p2.DbType = DbType.String;
>p2.Direction = ParameterDirection.Input;
>p2.ParameterName = "@Password";
>p2.Size = 50;
>p2.Value = "MyPaSsWoRd";
>IDataReader idr = command.ExecuteReader(CommandBehavior.CloseConnection);
>if( idr.Read() )
>I'm using the Data Access Application Block 3.1
> so this is not 100% the code I'm having in use. I've just stepped through and copied all
> important commands out of it.
>Has anybody an idea what the problem could be?
>Thanks in advance!