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

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
andrelau
Posts: 5
Joined: Tue 05 Oct 2010 08:35
Location: -1

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

Post by 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" ?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by 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).

andrelau
Posts: 5
Joined: Tue 05 Oct 2010 08:35
Location: -1

Post by 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

Post by 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.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 08 Oct 2010 11:29

We have replied you by e-mail.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 18 Oct 2010 09:42


Post Reply