cannot use space as a value for a not null field.

cannot use space as a value for a not null field.

Postby andrelau » Tue 05 Oct 2010 08:39

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" ?
andrelau
 
Posts: 5
Joined: Tue 05 Oct 2010 08:35
Location: -1

Postby AndreyR » Tue 05 Oct 2010 11:22

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).
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby andrelau » Tue 05 Oct 2010 12:04

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
andrelau
 
Posts: 5
Joined: Tue 05 Oct 2010 08:35
Location: -1

Postby andrelau » Tue 05 Oct 2010 13:47

We noticed another problem. (and this may be related).

The Database field is char( 8 ) and filled with 8 spaces.
When we read the field we get "" instead of " " (8 spaces) ?

We're using EF4, Riaservices.
andrelau
 
Posts: 5
Joined: Tue 05 Oct 2010 08:35
Location: -1

Postby AndreyR » Fri 08 Oct 2010 11:29

We have replied you by e-mail.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby Shalex » Mon 18 Oct 2010 09:42

Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle