Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8194397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:48:35+00:00 2026-06-07T04:48:35+00:00

NTEXT with more than 4000 characters in SQL Server CE in windows phone I

  • 0

NTEXT with more than 4000 characters in SQL Server CE in windows phone

I have a database in my windows phone app with a ntext field in one of the tables, I’m trying to write some content to this field, but I get an InvalidOperationException with the message:

String truncation: max=4000, len=4621

I am trying to use ntext because I know that nvarchar doesn’t accept more than 4000 chars.

I’ve searched for a solution but I couldn’t find any.

The only solution I found I cannot use on windows phone, because it uses the SqlConnection and SqlCommand with SqlDbType.

Here is how the columns is declared:

    private string _content;
    [Column(DbType="ntext")]
    public string Content
    {
        get
        {
            return _content;
        }
        set
        {
            if (value != _content)
            {
                _content = value;
                NotifyChange(o => o.Content);
            }
        }
    }

I’m inserting it with:

cn.Articles.InsertAllOnSubmit(articlesToSave); 
cn.SubmitChanges();

Does anyone know any workaround?

Thanks for the answers in advance!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:48:37+00:00Added an answer on June 7, 2026 at 4:48 am

    I think your column in the actual database file is not ntext, for whatever reason.

    This works fine for me:

        using (NorthwindContext ctx = new NorthwindContext(NorthwindContext.ConnectionString))
        {
            ctx.DeleteDatabase();
            ctx.CreateDatabase();
            var category = new Categories();
            category.CategoryName = "Test";
            category.Description = new string('x', 6666);
            ctx.Categories.InsertOnSubmit(category);
            ctx.SubmitChanges();
    
            var testCat = ctx.Categories.First();
            if (testCat.Description.Length == 6666)
            {
                MessageBox.Show("Works on my Windows Phone");                
            }
        }
    

    Column declaration:

    [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Description", DbType="NText", UpdateCheck=UpdateCheck.Never)]
            public string Description
            {
                get
                {
                    return this._Description;
                }
                set
                {
                    if ((this._Description != value))
                    {
                        this.OnDescriptionChanging(value);
                        this.SendPropertyChanging();
                        this._Description = value;
                        this.SendPropertyChanged("Description");
                        this.OnDescriptionChanged();
                    }
                }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When a SQL batch returns more than one message from e.g. print statements, then
I have to retrieve the more than 100 records from the Database table using
I have a page with more than one form. One form (see below example)
How to replace text in sql server 2000 in a ntext column with more
I know for more than one result, you don't have much choice for using
I have products that have more than one size. Is the next design good?
I am needing to run more than one Mysql Query using PHP. I have
I'm trying to update an NText field in SQL 2000 using Classic ASP. Here
I want to count the characters in an ntext field. Following Pinal Dave's advice,
I was a MySQL user. Now I'm migrating to SQL Server. But I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.