Helpex - Trao đổi & giúp đỡ Đăng nhập
7

This error occurs when data binding a repeater: SQL Server does not handle comparison of NText, Text, Xml, or Image data types

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 hữu ích 0 bình luận 9.2k xem chia sẻ
17

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

XML can never be compared as a string. XML snippets can be written in thousands of ways and result semantically in the same XML. Just think at namespaces and how they can be declared however one likes.

17 hữu ích 0 bình luận chia sẻ
loading
Không tìm thấy câu trả lời bạn tìm kiếm? Duyệt qua các câu hỏi được gắn thẻ sql linq-to-sql , hoặc hỏi câu hỏi của bạn.

Có thể bạn quan tâm

loading