SCM

[#1010727] Entity framework exception if null inserted in XML column

View Trackers | Bugs | Download .csv | Monitor

Date:
2009-11-10 22:03
Priority:
3
State:
Open
Submitted by:
Hendrik van Niekerk (hendrikfph)
Assigned to:
Nobody (None)
Npgsql Version:
None
Category:
Group:
Resolution:
None
Summary:
Entity framework exception if null inserted in XML column

Detailed description
I am using the .net data provider version 2.0.6.0.
Attempts to insert null into a nullable XML column results in an error

ERROR: 42804: column "XML" is of type xml but expression is of type character varying

you can however insert nulls into this column from the query tool

Is it possible that anyone might be able to assist? I have a sample application should anyone wish to reproduce.

1. I created a table
--------------------------
CREATE TABLE "TestXML"
(
"XML" xml,
"Str" character varying(50),
"Id" SERIAL,
CONSTRAINT "PK_TestXML" PRIMARY KEY ("Id")
)
WITH (
OIDS=FALSE
);
ALTER TABLE "TestXML" OWNER TO postgres;

2.Generated an edmx file with edmgen2 and create a c# winforms project
-----------------------------------

3.ran the code
----------------------

using( XMLSampleContext context = new XMLSampleContext() )
{
TestXML te = new TestXML();
te.Str = "XML no set";

context.AddToTestXML( te );
context.SaveChanges();
}

The exception was raised on the save

Followup

Message
Date: 2009-12-21 03:22
Sender: Josh Cooley

I was able to reproduce this issue and put a fix for this into CVS. If you can test this, please let me know how it works for you.

Attached Files:

Attachments:
TestEntityFramework.zip

Changes:

Field Old Value Date By
File Added437: TestEntityFramework.zip2009-11-10 22:03hendrikfph
Powered By FusionForge