22

Recently I was investigating this question: Storing long values in DataGridView C#. After some tests I found out that the DataGridViewCell will not display any text with a length larger than 43679 characters, even if the value is actually stored in the cell and you can access it programmatically.

Actually, this has also been reported as a bug for SQL Server Management Studio: SSMS - Can not paste more than 43679 characters from a column in Grid Mode.

I guess that the limit is intended to prevent any overload on the UI rendering. But my questions are:

  1. Why this exact value is being used?
  2. Is there any documentation for this limit?
Community
  • 1
  • 1
Alex Filipovici
  • 31,789
  • 6
  • 54
  • 78
  • 8
    *divide by... no, multiply by.. maybe in hex, square root of.. carry the 1, no...someone's birthday* **NO IDEA.** – Rotem Jan 16 '13 at 10:03
  • 1
    see http://stackoverflow.com/questions/2759721/how-do-i-view-the-full-content-of-a-text-or-varcharmax-column-in-sql-server-20 – Rachel Gallen Jan 26 '13 at 21:19
  • Here's an archive.org mirror of the link by Alex filipovici's comment: "*The upper exclusive limit is **43680**, which is **10920** * **4**. A bug about a 10919 limit was linked to Vista by Microsoft: [SSMS : Grid will not display > 10.919 caharacters from VARBINARY(MAX)](https://web.archive.org/web/20130106182200/http://connect.microsoft.com/SQLServer/feedback/details/344117/ssms-grid-will-not-display-10-919-characters-from-varbinary-max).*" – TylerH Dec 26 '21 at 23:10

1 Answers1

5

If convert 43679 to hex then it's 0xAAA0. Or in inverse form 0xAAA0 = 0xFFFF - 0x555F.

0x555F is code of Chinese Unicode symbol 'open; begin'. May be it is a Chinese message or some kind of Chinese magic)

Denis Kreshikhin
  • 8,856
  • 9
  • 52
  • 84