|
-
January 17th, 2006, 02:17 AM
#1
Multiline Textbox Using Query......
Hi All,
How to save multiline Textbox Using SQL Query .am saving using following SQL
<Code> = <\code>
SQL = " insert into Sitemaster (Srno,Site_name,Site_id,Bsc_id,Site_stru,Hub,Site_city,Dist_hq,Site_add )" & " values (" & txtsrno & ","
SQL = SQL & "'" & txtsitename.Text & "','" & txtsiteid.Text & "','" & txtbscid.Text & "','" & txtsitestru.Text & "',"
SQL = SQL & "'" & txthub.Text & "','" & txtsitecity.Text & "','" & txthq.Text & "','" & txtsiteadd.Text & "')"
Txtsiteadd will multiline textbox
but its saving only First line
while other lines are not saving
Appericiated Help
Thanks
Last edited by rajeshidea; January 17th, 2006 at 02:18 AM.
Reason: spellmistake
-
January 17th, 2006, 06:47 AM
#2
Re: Multiline Textbox Using Query......
I know that in MS Access, when you set up a table, it has a max # of characters in will accept if you make it a text column.
I had to make it a memo type, to actually allow more characters to go there.
It shouldn't really be a problem with multi-lines, because this is just a visual thing. It is all really just one line, it's just "wrapped" to look like multiple lines.
Give a little bit more information about where exactly you are saving this information
-
January 17th, 2006, 06:59 AM
#3
Re: Multiline Textbox Using Query......
 Originally Posted by rajeshidea
Hi All,
How to save multiline Textbox Using SQL Query .am saving using following SQL
<Code> = <\code>
SQL = " insert into Sitemaster (Srno,Site_name,Site_id,Bsc_id,Site_stru,Hub,Site_city,Dist_hq,Site_add )" & " values (" & txtsrno & ","
SQL = SQL & "'" & txtsitename.Text & "','" & txtsiteid.Text & "','" & txtbscid.Text & "','" & txtsitestru.Text & "',"
SQL = SQL & "'" & txthub.Text & "','" & txtsitecity.Text & "','" & txthq.Text & "','" & txtsiteadd.Text & "')"
Txtsiteadd will multiline textbox
but its saving only First line
while other lines are not saving
Appericiated Help
Thanks
As lready suggested by Buddy008, change the Field's Data type to Memo. In your case the field that needs to be changed is Site_add
ps: Follow the link in my signature on how to use Code Tags while posting Source Code.
-
January 17th, 2006, 08:30 AM
#4
Re: Multiline Textbox Using Query......
When you say "Txtsiteadd will multiline textbox", do you mean that the data in that textbox is in multiple lines? If so, you will need to get rid of carriage return and/or line feed characters before using in you SQL statement.
You could try something like this:
Code:
SQL = SQL & "'" & txthub.Text & "','" & txtsitecity.Text & "','" & txthq.Text & "','" & Replace(txtsiteadd.Text, vbCrLf, " ") & "')"
If kids were left to their own devices, would they ever come up with a thing like war?......The Wheel / Todd Rundgren
Do canibals not eat clowns because they taste funny? 
-
May 11th, 2010, 04:38 AM
#5
Re: Multiline Textbox Using Query......
Its check each character’s ASCII value entered into the textbox, so when the enter key is pressed its also check the ASCII value and then it avoid to insert the carriage return value to the textbox. So we can avoid to insert Carriage Return into the textbox having “ Multiline” TextMode property or in TextArea control.
<asp:TextBox ID="txtComments" Height="150" Columns="200" TextMode="multiline" MaxLength="4000" runat="server" onkeydown = "return (event.keyCode!=13);" />
Note: ASCII value for Enter Key is 13.
http://www.mindfiresolutions.com/Res...ontrol-535.php
-
May 11th, 2010, 08:58 AM
#6
Re: Multiline Textbox Using Query......
Still reviving dead threads? Answer is 4 years late.
-
May 11th, 2010, 08:58 PM
#7
Re: Multiline Textbox Using Query......
 Originally Posted by WoF
Still reviving dead threads? Answer is 4 years late.
And is incorrect. Access can handle multiline entries just fine I have quite a few of them in various databases and I have not stripped a single CRLF from them. Not to mention that it is ASP code instead of VB6
Always use [code][/code] tags when posting code.
-
May 12th, 2010, 12:20 AM
#8
Re: Multiline Textbox Using Query......
Multiline TB doesn't have VbCrLf to distinguish between lines. That's why it resizes
-
May 12th, 2010, 12:33 AM
#9
Re: Multiline Textbox Using Query......
Not sure what you mean there. It is true that a multiline textbox can be set to word wrap depending on what your scroll bar settings are but it also works properly with the CRLF no matter what scroll mode it is in.
Always use [code][/code] tags when posting code.
-
May 12th, 2010, 02:38 AM
#10
Re: Multiline Textbox Using Query......
If you don't add them, there's no need to parse them out
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|