0

Hi,

Does anyone know how too solve this:

I want to delete a row from database and I keep getting this error:
The ntext and image data types cannot be used in WHERE, HAVING, GROUP BY, ON, or IN clauses, except when these data types are used with the LIKE or IS NULL predicates. delete from database

string test = "test";
Message m = db.Messages.Single(p => p.Name.StartsWith(test))
db.Messages.DeleteOnSubmit(m);
db.SubmitChanges();

Table name is Messages
Name is type ntext

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by zmeditation1
0

Delete based on an Id column. You've really already answered your own problem. Name is type nText and you are using it in a where clause (look at your lambda expression). So basically don't use Name in your lambda.

0

Can I delete it without using the lambda expression? I mean the row where Name == text ?

0

I got the same error for this query :

Aktive a = da.Aktive.First(p => p.Average.Equals(22.4));

da.Aktive.DeleteOnSubmit(a);
da.SubmitChanges();

In this example Average is type float

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.