. Advertisement .
..3..
. Advertisement .
..4..
Hi guys,
I was making a little bit of coding today and I got this error ”the data types text and varchar are incompatible in the equal to operator.” when I run this code
Tpe tp = (from x in ctx.Tpe
where x.Ute == DropDownList1.Text
select x).First();
Ute is a text type, so I fail to understand why it gives me a type error.
Can someone help me?
The cause: This text data type is deprecated, it is not suitable for comparing string.
Solution: You can fix the error by changing the type into nvarcha instead of text.