When I try to insert a new row using the Execute command, I get the following error:
column "name" does not exist
at Devart.Data.PostgreSql.e.f(r A_0)
at Devart.Data.PostgreSql.r.n()
at Devart.Data.PostgreSql.PgSqlCommand.InternalPrepare(Boolean implicitPrepare, Int32 startRecord, Int32 maxRecords)
at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior)
at Devart.Common.DbCommandBase.ExecuteNonQuery()
at Dapper.SqlMapper.ExecuteCommand(IDbConnection cnn, CommandDefinition& command, Action`2 paramReader)
at Dapper.SqlMapper.ExecuteImpl(IDbConnection cnn, CommandDefinition& command)
at Dapper.SqlMapper.Execute(IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable`1 commandTimeout, Nullable`1 commandType)
My object definition is this:
public class Label
{
public string Name { get; set; }
public string Description { get; set; }
}
My execute command is this:
string command = @"INSERT INTO label (name, description) VALUES (@name, @description)";
using (IDbConnection connection = new PgSqlConnection(connectionString))
{
connection.Open();
Label label = new Label
{
Name = "DapperTest",
Description = "test",
};
connection.Execute(command, label, commandType: CommandType.Text);
}
The code above works with Npgsql.
When I try to insert a new row using the
Executecommand, I get the following error:My object definition is this:
My execute command is this:
The code above works with
Npgsql.