469,591 Members | 2,096 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,591 developers. It's quick & easy.

Multi-Line TextBox writting to Sql Server

I have a problem writing the text from a multi-line textbox to the Sql
Server db.
If the user sends a vbcrlf (enter key) in the middle of the entered text,
the text gets
truncated at the vbcrlf when writting the data to the database. The text
could get rather long.
The dataset has all of the text (including the vbcrlf), but the resulting
table field in the database only ends up with the portion of text before the
vbcrlf.

I'm use a sql dataadapter with a parameter for the insert and update
commands
SqlParameter("@Plan2", System.Data.SqlDbType.NVarChar, 1000, "Plan2"))

and the table is nvarchar(1000). The typed dataset xml shows as a string.

<xs:element name="Plan2" type="xs:string" minOccurs="0" />

Do I need to strip out the Vbcrlf from the datset field before issuing the
update? or is there something else I could do?

I'm sure the users will hit the Enter Key in the textbox, so what ever I do
needs to be behind the scenes.

Thanks,

John

Nov 18 '05 #1
2 2514
I apologize if this insults your intelligence.

Are you trying to look at the table through enterprise manager. If so, then
it will only show you one line at a time, you will have to scroll down the
cell to see the rest.

If you look at it through query analyzer, it will show all the data in one
line with extra spaces.

HTH,

bill
"John Carnahan" <ca********@msn.com> wrote in message
news:uy**************@tk2msftngp13.phx.gbl...
I have a problem writing the text from a multi-line textbox to the Sql
Server db.
If the user sends a vbcrlf (enter key) in the middle of the entered text,
the text gets
truncated at the vbcrlf when writting the data to the database. The text
could get rather long.
The dataset has all of the text (including the vbcrlf), but the resulting
table field in the database only ends up with the portion of text before the vbcrlf.

I'm use a sql dataadapter with a parameter for the insert and update
commands
SqlParameter("@Plan2", System.Data.SqlDbType.NVarChar, 1000, "Plan2"))

and the table is nvarchar(1000). The typed dataset xml shows as a string.

<xs:element name="Plan2" type="xs:string" minOccurs="0" />

Do I need to strip out the Vbcrlf from the datset field before issuing the
update? or is there something else I could do?

I'm sure the users will hit the Enter Key in the textbox, so what ever I do needs to be behind the scenes.

Thanks,

John

Nov 18 '05 #2
You didn't insult my intelligence... I'm thinking I don't have any to
insult!
Actually, I was querying the table after the insert, and the data was
truncated. I did a little routine that strips out the vbcrlf's
and it works ok now. I'm sure there is a better solution to this, but it
seems to work. I used a StringReader to readLine() the
string into a new string, and then stuffed that into the dataset before
saving it to the database. The readLine strips out the vbcrlf's.
If you have a better way to do this, please shout.
Thanks,
John

"William F. Robertson, Jr." <wf*********@kpmg.com> wrote in message
news:u4**************@TK2MSFTNGP09.phx.gbl...
I apologize if this insults your intelligence.

Are you trying to look at the table through enterprise manager. If so, then it will only show you one line at a time, you will have to scroll down the
cell to see the rest.

If you look at it through query analyzer, it will show all the data in one
line with extra spaces.

HTH,

bill
"John Carnahan" <ca********@msn.com> wrote in message
news:uy**************@tk2msftngp13.phx.gbl...
I have a problem writing the text from a multi-line textbox to the Sql
Server db.
If the user sends a vbcrlf (enter key) in the middle of the entered text, the text gets
truncated at the vbcrlf when writting the data to the database. The text
could get rather long.
The dataset has all of the text (including the vbcrlf), but the resulting table field in the database only ends up with the portion of text before

the
vbcrlf.

I'm use a sql dataadapter with a parameter for the insert and update
commands
SqlParameter("@Plan2", System.Data.SqlDbType.NVarChar, 1000, "Plan2"))

and the table is nvarchar(1000). The typed dataset xml shows as a string.
<xs:element name="Plan2" type="xs:string" minOccurs="0" />

Do I need to strip out the Vbcrlf from the datset field before issuing the update? or is there something else I could do?

I'm sure the users will hit the Enter Key in the textbox, so what ever I

do
needs to be behind the scenes.

Thanks,

John


Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

37 posts views Thread by ajikoe | last post: by
4 posts views Thread by Frank Jona | last post: by
17 posts views Thread by =?Utf-8?B?R2Vvcmdl?= | last post: by
2 posts views Thread by Aussie Rules | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.