Showing posts with label equal. Show all posts
Showing posts with label equal. Show all posts

Sunday, February 26, 2012

Error:Cannot resolve collation conflict for equal to operation.

Exception information:System.Data.SqlClient.SqlException: Cannot resolve collation conflict for equal to operation.
Who can tell me how to resolve this problem?
ThxIs this an error you've seen here on the ASP.NET Forums? (After all, you've posted this message in the forum dedicated to ASP.NET Forum bugs and discussions.)

Or, is this an error in your own application? If so, I will move this thread into theSQL Server and MSDE forum.|||Maybe I made a mistake.(I just met this error in my own server with asp.net environment)|||You've got mixed collations, this typically occurs when your underlying tables collation doesn't match the servers default collation. You need to specify the collation you want to use in the query. Look up COLLATE and DATABASE_DEFAULT.

It's also a common gotcha if you're using table vars, for the same reason, the same "COLLATE database_default" does the trick.

Sunday, February 19, 2012

Error: The data types text and text are incompatible in the equal to operator.

I get this error:

The data types text and text are incompatible in the equal to operator.

when trying to execute this query

SELECT id FROM users WHERE username=@.userName

Any Ideas?We'll need to know te data type of the username column, as well as the SqlDbType you are using for the @.userName parameter.|||I'm using text and text.|||Can't do that. There are a number of things that you can't do with blob data types, and that's one of them. Considering the name of the field is username, I'm guessing that you should be using varchar instead.