Skip to content

NotSupportedException calling AddWithValue with enum #255

@bgrainger

Description

@bgrainger

Calling command.Parameters.AddWithValue("@name", SomeEnum.Value) throws the following exception:

 System.NotSupportedException : Parameter type SomeEnum (DbType: AnsiString) not currently supported. Value: Value
Stack Trace:
   at MySql.Data.MySqlClient.MySqlParameter.AppendSqlString(BinaryWriter writer, StatementPreparerOptions options)
   at MySql.Data.MySqlClient.MySqlStatementPreparer.ParameterSqlParser.DoAppendParameter(Int32 parameterIndex, Int32 textIndex, Int32 textLength)
   at MySql.Data.MySqlClient.MySqlStatementPreparer.ParameterSqlParser.OnNamedParameter(Int32 index, Int32 length)
   at MySql.Data.MySqlClient.MySqlParser.Parse(String sql)
   at MySql.Data.MySqlClient.MySqlStatementPreparer.ParseAndBindParameters()
   at MySql.Data.MySqlClient.CommandExecutors.TextCommandExecutor.<ExecuteReaderAsync>d__3.MoveNext()

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions