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, @p8)
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