Linq to SQL error SQL does not compare NText, Text, Xml, or Image?

When trying to do an update for a Linq object I receive the following error.

"SQL Server does not handle comparison of NText, Text, Xml, or Image data types."

There is a field in the database that is a Text field because it is going to hold a string that could be as much as 32kb.

Should I change the data type or is there a work around in Linq I could use?

EDIT

I have support SQL 2000 which is why it is a TEXT field.

-------------Problems Reply------------

Change it to a VARCHAR(max) - it will make life much easier.



EDIT

Full text indexing may help you here, not sure if SQL 2000 would allow you to then "search" on your text column

you can always use ToString() on the string in question which will force client side comparison.

Or you could set UpdateCheck in code:

[Column(Name = "SomeXml", Storage = "_someXml", CanBeNull = true, UpdateCheck = UpdateCheck.Never)]
public System.Xml.Linq.XDocument SomeXml { get { return _someXml; } set { _someXml = value; } }

You can manually change the Update Check to "Never" in the .dbml.

Category:.net Views:4 Time:2009-05-15

Related post

  • Linq to SQL error SQL does not compare Xml? 2011-08-10

    is it possible to use a datacontext or LINQ when you have an XML field? we succeed in updating the xml field in but once it is in the db, we cannot update any other fields due to the above error. we tried setting the (UpdateCheck=UpdateCheck.Never) o

  • SQL Error: SQL Syntax Error 2010-01-04

    Error Message: SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND domain = 'ard.qc' AND snapshot_id = 2010 AND locale = 'en_US'' at line 1 SQL Query: S

  • Reraise SQL Error - SQL Error Getting Lost 2012-04-27

    I have a DataSnap method that logs a deleted record before it is deleted. If the delete fails, I rollback the transaction so that the log record isn't kept either. A classic reason for a failure is that the record that is being deleted is in use in a

  • How do I use application/xml as compared to text/xml? 2011-05-26

    In the web service I've been working on, I've been displaying text to the screen through methods like so in HTML: @GET @Produces(MediaType.TEXT_HTML) public String sayHtmlHello() { /**Do some stuff return "<html> " + "<title>" + "Hello" +

  • LINQ to Entities generated SQL inefficient compared to LINQ to SQL generated SQL? 2010-11-19

    We started to migrate a project from VS2008 with stored procedures to VS2010 with the Entity Framework 4 as ORM. Now I had to do a rather complex LINQ query to get the data out of our database. I usually first try to figure out the LINQ query using L

  • compare ntext by string in sql server 2005 by linq 2011-03-11

    How can I compare ntext type in sql server 2005 to string with linq? in sql server 2005; @a as ntext linq in c#; string b; var k=from p in DataContext.TableName where p.a.toString()==b) select p; //return k=null --------------Solutions------------- N

  • Linq to SQL .Equals returns true when comparing int to string --> Id.Equals("5") returns true 2012-02-17

    We have a new developer that is just now learning LinqToSql. While going over his code, we noticed that he was using .Equals instead of == for a value comparison. On top of that, he is comparing an int with a string. What completely baffled us, was t

  • Error:SQL Problems: ERROR :operator does not exists:date>= character varying 2009-10-15

    i am using iReport 3.6.0 with postgresql database ,for date type parameter its giving the following error when writing query "Error:SQL Problems: ERROR :operator does not exists:date>= character varying" please help --------------Solutions--------

  • Is this LINQ statment vulnerable to SQL injection? 2010-09-29

    Is this LINQ statment vulnerable to SQL injection? var result = from b in context.tests where b.id == inputTextBox.Text select b; where context is an Entity and tests is a table. I'm trying to learn LINQ and I thought that the benefit of it was that

  • SQL Error ORA-00933: SQL command not properly ended / Java 2012-03-14

    Right, This code below should do the following, Create an SQL statement that will find the free routeId by comparing two tables, a Booking table with the booked ID and a route table with ALL the ID's This should return the ID of the free routes, whic

  • BizTalk SSO configuration and SQL Error 18456, Severity 14, State 16 2008-12-30

    I'm having a major issue trying to configure a new install of BizTalk Server 2006 (not R2). The server had BizTalk installed on it before, and it was working fine. I've uninstalled BizTalk, removed the databases and jobs from the SQL server, which is

  • Sql error while running query data type mismatch in criteria expression 2009-03-10

    I'm getting the following error while running the SQL query given below 'Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression., SQL state 22005?T in SQLExecDirect in

  • SQL error: misuse of aggregate 2009-03-15

    SQLite version 3.4.0 What's wrong with aggregate functions? Additionally, I suspect that ORDER BY won't work as well. How to rewrite this? sqlite> SELECT p1.domain_id, p2.domain_id, COUNT(p1.domain_id) AS d1, COUNT(p2.domain_id) AS d2 ...> FROM

  • Linq-to-SQL ignores SQL Server default value 2009-07-13

    When using Linq-to-SQL, adding a column to an existing table, and setting a default value on that new column, it seems that Linq to SQL ignores the default value. Has anyone else experienced this behaviour? Is there a way to fix it, so that Linq-to-S

  • SQL Error: The multi-part identifier "tableName.ColumnName" could not be bound 2009-08-11

    When LEFT JOINing tables in a SQL query, sometimes I need to reference multiple tables in the ON clause. For example: SELECT p.Name, j.Job, s.Salary FROM PeopleTable p, JobTable j LEFT JOIN SalaryTable s ON s.PeopleID=p.PeopleID AND s.JobID=j.JobID H

  • Error #3115: SQL Error 2009-08-25

    I keep getting this error when I try to commit a group of executed statements. Details are blank and the message just doesn't give enough information ('SQL Error' only). Anyone run into this error, or have any ideas? --------------Solutions----------

  • Spring - Ingres RDBMS support in sql-error-codes.xml error code mapping file 2009-10-28

    I have a Java project connecting to an Ingres database and using the Spring Framework. This issue is related to the error codes list configuration. According to Spring Framework API: Class SQLErrorCodes: JavaBean for holding JDBC error codes for a pa

  • Oracle "SQL Error: Missing IN or OUT parameter at index:: 1" 2009-11-17

    I have an Oracle script that looks like the following: variable L_kSite number; variable L_kPage number; exec SomeStoredProcedureThatReturnsASite( :L_kSite ); exec SomeStoredProcedureThatAddsAPageToTheSite( :L_kSite, :L_kPage ); update SiteToPageLink

  • SQL error: String or binary data would be truncated 2009-12-11

    I'm doing an integration on a community platform called Telligent. I'm using a 3rd-party add-on called BlogML to import blog posts from an XML file (in BlogML format) into my local Telligent site. The Telligent platform comes with many classes in the

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.156 (s). 11 q(s)