Click to See Complete Forum and Search --> : inserting a textarea text into a db
pelegk1
12-07-2005, 01:50 AM
i have tried to insert a text from a textaread to a DB where the col defined as nvarchar(4000)
when i try to do this i have 2 problem :
1)characters like (') or (") make me problem with the insert string
2)i am getting a message that max cgars allowed to insert is 128
(i am trying to insert hebrew text)
what can be the problem?
thnaks i nadvance
peleg
Cipher
12-07-2005, 05:55 AM
I'm not sure about your request, buy make the sure that the MaxLength attribute of the textbox is set to "4000"
PeOfEo
12-07-2005, 09:40 AM
what kind of db are you using? If it is access make s ure the db field type is memo.
PeOfEo
12-07-2005, 09:40 AM
I'm not sure about your request, buy make the sure that the MaxLength attribute of the textbox is set to "4000"
there is no maxlength attribute for a text area, textbox yes, but this is a text area.
Cipher
12-07-2005, 02:41 PM
i think asp tags have maxlength?! i'm not sure but i guess so
PeOfEo
12-07-2005, 05:06 PM
I don't believe so. I think there is but it only works with a single line one and does nothing for multiline and oyu have to do it manually with an if statement.
Cstick
12-08-2005, 09:52 PM
You should be using SQL parameters, doing so will solve both of your problems and add some protection against SQL injection. The asp textbox accepts a Maxlength attribute for both single and multiple line text boxes however it only works for the single line textbox. For multiline textboxes you should manually check the max length is not exceeded on each postback. If your users exceed the 4000 character size then SQL will throw an error about truncating strings.
pelegk1
12-09-2005, 12:22 AM
ok thanks alot