The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

stasevich (1) [Avatar] Offline
#1
I am trying to do simple insert using LINQ to a table that has an XML Data Type column, column allows null, so I do not assign any value to this column


Msg 305, Level 16, State 1, Line 2
The xml data type cannot be compared or sorted, except when using the IS NULL operator.

here's the code:

Dim newReqService As New ReqService
newReqService.ServiceID = 1
newReqService.ReqID = 1

db.ReqServices.InsertOnSubmit(newReqService)
db.SubmitChanges()

here's the sql statement that LINQ produces

exec sp_executesql N'INSERT INTO [dbo].[ReqServices]([ReqID], [ServiceID], [DateCreated], [DateLastUpdated], [DateFollowup], [DateClosed], [StatusID], [UserName], [CustomerData])
VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @psmilie

SELECT CONVERT(BigInt,SCOPE_IDENTITY()) AS [value]',N'@p0 int,@p1 tinyint,@p2 datetime,@p3 datetime,@p4 datetime,@p5 datetime,@p6 int,@p7 varchar(8000),@p8 xml',@p0=1,@p1=1,@p2=NULL,@p3=NULL,@p4=NULL,@p5=NULL,@p6=NULL,@p7=NULL,@p8=NULL



anyone had a smiliar issue or knows how to solve this issue?