Hello.
The database we use is not designed by us.
In one table, the Key is composed of 4 fields and for some of them, " " (space) is a correct and meaning value.
So we assign the space value to the C# field and when we save it crash
=> The xxxxxx Field is required.
EF Bug ?
Any solution to overide the "trim effect" ?
cannot use space as a value for a not null field.
I have made a test using both Devart Entity model and Microsoft Entity Framework model and succeeded to insert an entity with the varchar2 key equal to " ".
Could you please send us a small test project illustrating the problem?
If possible, please include the information about the database layer (DDL script would be a great option).
Could you please send us a small test project illustrating the problem?
If possible, please include the information about the database layer (DDL script would be a great option).
It's a C#project, EntityFW model.
CREATE TABLE "TABxxxx"
(
"keypart1" CHAR(8 BYTE) NOT NULL ENABLE,
"keypart2" CHAR(8 BYTE) NOT NULL ENABLE,
"keypart3" CHAR(3 BYTE) NOT NULL ENABLE,
"keypart4" CHAR(2 BYTE) NOT NULL ENABLE,
"keypart5" CHAR(3 BYTE) NOT NULL ENABLE,
some other fields,....
CONSTRAINT "TABxxxx_PK" PRIMARY KEY ("keypart3", "keypart2", "keypart4", "keypart5", "keypart1") ENABLE )
Mapping is made as
keypart5 : CHAR keypart5 : String
CREATE TABLE "TABxxxx"
(
"keypart1" CHAR(8 BYTE) NOT NULL ENABLE,
"keypart2" CHAR(8 BYTE) NOT NULL ENABLE,
"keypart3" CHAR(3 BYTE) NOT NULL ENABLE,
"keypart4" CHAR(2 BYTE) NOT NULL ENABLE,
"keypart5" CHAR(3 BYTE) NOT NULL ENABLE,
some other fields,....
CONSTRAINT "TABxxxx_PK" PRIMARY KEY ("keypart3", "keypart2", "keypart4", "keypart5", "keypart1") ENABLE )
Mapping is made as
keypart5 : CHAR keypart5 : String
Please refer to http://www.devart.com/forums/viewtopic.php?p=62042.