SQL Server Does Not Handle NText, Text, Xml, or Image File Type Comparison

This error occurs when data binds a repeater: SQL Server does not handle NText, Text, Xml, or Image data type comparisons

protected void Page_Load(object sender, EventArgs e) { topicid = Convert.ToInt32(Request.QueryString["topic".ToString()]); if (!IsPostBack) { MusicForumDataContext db = new MusicForumDataContext(); var query = from p in db.posts where p.categoryid == NAME select p; rptposts.DataSource = query; rptposts.DataBind(); <---- ERROR } } 
+7
sql linq-to-sql
source share
1 answer

The NTEXT, TEXT, and IMAGE types are deprecated and must be replaced by the types NVARCHAR (MAX), VARCHAR (MAX), and VARBINARY (MAX). New types support string operators, including equality comparisons.

XML can never be compared as a string. XML fragments can be written in thousands of ways and semantically result in one XML. Just think about namespaces and how they can be declared, but like.

+16
source share

All Articles