Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: VS: Text Datatype Problem


Message #1 by "Teemu Keiski" <wroxhelp@m...> on Wed, 28 Aug 2002 19:00:00 +0300
If you define the length in SQLParameter like that it really means 16
characters (it's parameters definition not text data type's)

About text:"
Variable-length non-Unicode data in the code page of the server and with
a maximum length of 231-1 (2,147,483,647) characters. When the server
code page uses double-byte characters, the storage is still
2,147,483,647 bytes. Depending on the character string, the storage size
may be less than 2,147,483,647 bytes.
"

So define the parameter something like (assuming you dont use Unicode or
something):
-------------------------
Teemu Keiski
Designer/Developer
Mansoft tietotekniikka Oy
Finland
MyCommand.Parameters.Add(New SqlParameter("@Release_Body",
SqlDbType.Text, 2147483647))



-----Alkuper=E4inen viesti-----
L=E4hett=E4j=E4: Mitchell Adams [mailto:MADAMS@p...]
L=E4hetetty: 28. elokuuta 2002 18:50
Vastaanottaja: ASP+
Aihe: [aspx] Text Datatype Problem


I've got a column in SQL Server 2000 set as a text datatype with a size
of 16.

I'm trying to insert some data into this column but all that's getting
put in is the first 16 characters


code:
'Create and Add Parameter
MyCommand.Parameters.Add(New SqlParameter("@Release_Body",
SqlDbType.Text, 16))

'Set the value to that of a textbox's text
MyCommand.Parameters("@Release_Body").Value =3D HTMLEdit.Text




I realize that the column should only be holding a pointer to the rest
of the text but I don't know how to get to the rest of the text if it is
indeed working....

Text in row is turned off.

Any help is appreciated.

Thanks

Mitch




---

ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=3D1861007442

ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=3D1861007450

These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples. 

---

Message #2 by "Teemu Keiski" <wroxhelp@m...> on Wed, 28 Aug 2002 19:01:59 +0300
Damn...signature was in wrong place...=3D)

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

If you define the length in SQLParameter like that it really means 16
characters (it's parameters definition not text data type's)

About text:"
Variable-length non-Unicode data in the code page of the server and with
a maximum length of 231-1 (2,147,483,647) characters. When the server
code page uses double-byte characters, the storage is still
2,147,483,647 bytes. Depending on the character string, the storage size
may be less than 2,147,483,647 bytes. "

So define the parameter something like (assuming you dont use Unicode or
something):
MyCommand.Parameters.Add(New SqlParameter("@Release_Body",
SqlDbType.Text, 2147483647))

-------------------------
Teemu Keiski
Designer/Developer
Mansoft tietotekniikka Oy
Finland


-----Alkuper=E4inen viesti-----
L=E4hett=E4j=E4: Mitchell Adams [mailto:MADAMS@p...]
L=E4hetetty: 28. elokuuta 2002 18:50
Vastaanottaja: ASP+
Aihe: [aspx] Text Datatype Problem


I've got a column in SQL Server 2000 set as a text datatype with a size
of 16.

I'm trying to insert some data into this column but all that's getting
put in is the first 16 characters


code:
'Create and Add Parameter
MyCommand.Parameters.Add(New SqlParameter("@Release_Body",
SqlDbType.Text, 16))

'Set the value to that of a textbox's text
MyCommand.Parameters("@Release_Body").Value =3D HTMLEdit.Text




I realize that the column should only be holding a pointer to the rest
of the text but I don't know how to get to the rest of the text if it is
indeed working....

Text in row is turned off.

Any help is appreciated.

Thanks

Mitch




---

ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=3D1861007442

ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=3D1861007450

These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples. 

---

Message #3 by "Mitchell Adams" <MADAMS@p...> on Wed, 28 Aug 2002 12:01:20 -0400
I did try changing the number of characters in the parameter. 
 MyCommand.Parameters.Add(New SqlParameter("@Release_Body", SqlDbType.Text,
 10000))

It would still trim off after about 5,000 characters were inserted.

Any other ideas?

Thanks

Mitch




>>> wroxhelp@m... 08/28/02 12:00PM >>>
If you define the length in SQLParameter like that it really means 16
characters (it's parameters definition not text data type's)

About text:"
Variable-length non-Unicode data in the code page of the server and with
a maximum length of 231-1 (2,147,483,647) characters. When the server
code page uses double-byte characters, the storage is still
2,147,483,647 bytes. Depending on the character string, the storage size
may be less than 2,147,483,647 bytes.
"

So define the parameter something like (assuming you dont use Unicode or
something):
-------------------------
Teemu Keiski
Designer/Developer
Mansoft tietotekniikka Oy
Finland
MyCommand.Parameters.Add(New SqlParameter("@Release_Body",
SqlDbType.Text, 2147483647))



-----Alkuper=E4inen viesti-----
L=E4hett=E4j=E4: Mitchell Adams [mailto:MADAMS@p...]
L=E4hetetty: 28. elokuuta 2002 18:50
Vastaanottaja: ASP+
Aihe: [aspx] Text Datatype Problem


I've got a column in SQL Server 2000 set as a text datatype with a size
of 16.

I'm trying to insert some data into this column but all that's getting
put in is the first 16 characters


code:
'Create and Add Parameter
MyCommand.Parameters.Add(New SqlParameter("@Release_Body",
SqlDbType.Text, 16))

'Set the value to that of a textbox's text
MyCommand.Parameters("@Release_Body").Value =3D HTMLEdit.Text




I realize that the column should only be holding a pointer to the rest
of the text but I don't know how to get to the rest of the text if it is
indeed working....

Text in row is turned off.

Any help is appreciated.

Thanks

Mitch




---

ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=3D1861007442

ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=3D1861007450

These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples. 

---


---

ASP.NET 1.0 Namespace Reference with C#
http://www.wrox.com/acon11.asp?ISBN=3D1861007442

ASP.NET 1.0 Namespace Reference with VB.NET
http://www.wrox.com/acon11.asp?ISBN=3D1861007450

These books are a complete reference to the ASP.NET namespaces
for developers who are already familiar with using ASP.NET.
There is no trivial introductory material or useless .NET
hype and the presentation of the namespaces, in an easy-to use
alphabetical order ensures a user-friendly reference format.
We provide in-depth coverage of all the major ASP.NET classes,
giving you those real-world tips that the documentation doesn't
offer, and demonstrating complex techniques with simple
examples.

---


  Return to Index