Seems it gets truncated on the application side then, make sure you use a
datatype in your application that can hold nText and also if you use some
kind of control like textbox check so it's not the control thet trunkate it.
-Stefan-
<czl1129@gmail.com> skrev i meddelandet
news:1176785685.445099.11030@l77g2000hsb.googlegroups.com...
[quoted text, click to view] > Maybe I'm missing something here. It seems what I'm trying to do is
> pretty simple. I'm trying to query a database field with data type
> ntext, and the content is greater than 8000 in length. I'm using .NET
> 1.1 framework to run a query.
>
> SqlCommand cmd = new SqlCommand("SELECT message_body from tblMessages
> where id = 1", conn);
> conn.open();
> String s = (string) cmd.ExecuteScalar();
> Console.Write(s.length)
>
> The full length of the text is about 8200, but the most i can ever
> query out is 8000. Can someone tell me why? I know i have the full
> length inside the database, because i can get the whole thing through
> Query Analyser.
>
You don't say what version of SQL Server you are running. Here's a
link to obtaining BLOBs from SQLS 2000
http://msdn2.microsoft.com/en-us/library/87z0hy49(vs.80).aspx and
here's one for large value types in SQLS 2005
http://msdn2.microsoft.com/en-us/library/a1904w6t(VS.80).aspx.
--Mary
[quoted text, click to view] On 16 Apr 2007 21:54:45 -0700, czl1129@gmail.com wrote:
>Maybe I'm missing something here. It seems what I'm trying to do is
>pretty simple. I'm trying to query a database field with data type
>ntext, and the content is greater than 8000 in length. I'm using .NET
>1.1 framework to run a query.
>
>SqlCommand cmd = new SqlCommand("SELECT message_body from tblMessages
>where id = 1", conn);
>conn.open();
>String s = (string) cmd.ExecuteScalar();
>Console.Write(s.length)
>
>The full length of the text is about 8200, but the most i can ever
>query out is 8000. Can someone tell me why? I know i have the full
>length inside the database, because i can get the whole thing through
[quoted text, click to view] On Apr 16, 9:54 pm, czl1...@gmail.com wrote:
> Maybe I'm missing something here. It seems what I'm trying to do is
> pretty simple. I'm trying to query a database field with data type
> ntext, and the content is greater than 8000 in length. I'm using .NET
> 1.1 framework to run a query.
>
> SqlCommand cmd = new SqlCommand("SELECT message_body from tblMessages
> where id = 1", conn);
> conn.open();
> String s = (string) cmd.ExecuteScalar();
> Console.Write(s.length)
>
> The full length of the text is about 8200, but the most i can ever
> query out is 8000. Can someone tell me why? I know i have the full
> length inside the database, because i can get the whole thing through
> Query Analyser.
Sorry I had a brain fart. The above code does work for SQL2000, i just
had it pointed to the wrong DB. :-)
Have you tried to CAST it to a VARCHAR(max)?
[quoted text, click to view] <czl1129@gmail.com> wrote in message
news:1176785685.445099.11030@l77g2000hsb.googlegroups.com...
> Maybe I'm missing something here. It seems what I'm trying to do is
> pretty simple. I'm trying to query a database field with data type
> ntext, and the content is greater than 8000 in length. I'm using .NET
> 1.1 framework to run a query.
>
> SqlCommand cmd = new SqlCommand("SELECT message_body from tblMessages
> where id = 1", conn);
> conn.open();
> String s = (string) cmd.ExecuteScalar();
> Console.Write(s.length)
>
> The full length of the text is about 8200, but the most i can ever
> query out is 8000. Can someone tell me why? I know i have the full
> length inside the database, because i can get the whole thing through
> Query Analyser.
>
Don't see what you're looking for? Try a search.