473,386 Members | 1,598 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Saving contents of a Richtext box to a database

I am having problems putting the RTF into a variable. Eg..

strText &= "FIRST TEXT"
strText &= RichTextbox1.RTF
strText &= "MORE TEXT HERE"

The problem is anything after the RTF is dropped off. If I look at the
strText it will have the "FIRST TEXT" and the content of the RTF file, but
not the "more text here"

Is this a bug or am I doing something so obvious that I can see it?

Regards,
Mike
Nov 20 '05 #1
3 2499
Hello,

"Mike Stephens" <no************@nosuchdomain.com> schrieb:
I am having problems putting the RTF into a variable. Eg..

strText &= "FIRST TEXT"
strText &= RichTextbox1.RTF
strText &= "MORE TEXT HERE"

The problem is anything after the RTF is dropped off. If I
look at the strText it will have the "FIRST TEXT" and the
content of the RTF file, but not the "more text here"


Maybe the text of the RichTextBox is terminated by a nullchar
('ControlChars.NullChar'). The messagebox and the IDE show only the
part of the text up to the first nullchar in the text, nevertheless, the
data is stored in the string.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2
I've tried all sorts, and so far nothing has worked. No matter what I do
the string is terminated.
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:eh**************@TK2MSFTNGP10.phx.gbl...
Hello,

"Mike Stephens" <no************@nosuchdomain.com> schrieb:
I am having problems putting the RTF into a variable. Eg..

strText &= "FIRST TEXT"
strText &= RichTextbox1.RTF
strText &= "MORE TEXT HERE"

The problem is anything after the RTF is dropped off. If I
look at the strText it will have the "FIRST TEXT" and the
content of the RTF file, but not the "more text here"


Maybe the text of the RichTextBox is terminated by a nullchar
('ControlChars.NullChar'). The messagebox and the IDE show only the
part of the text up to the first nullchar in the text, nevertheless, the
data is stored in the string.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #3
Hello,

"Mike Stephens" <no************@nosuchdomain.com> schrieb:
I've tried all sorts, and so far nothing has worked. No matter what
I do the string is terminated.


Try this:

\\\
Me.TextBox1.Text = Replace(s, ControlChars.NewLine, "")
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bob Murdoch | last post by:
We have an asp application that creates reports from a database. The managers would like to create the report, view the results, add a comment, and save the report so that he can send a link to...
0
by: Lukas Thanei | last post by:
Hi, Im trying for 2 days to solve a problem but now Im on a point where all ideas exhausted. Im writing a software to print out some cards containing richtext and images. To print the...
2
by: Du | last post by:
I like richtext textbox and its shortcut, but I don't need the richtext format. How do I tell the richtext text box to strips all the format and convert everything to plain text? Thanks
4
by: dale zhang | last post by:
Hi, I am trying to save and read an image from MS Access DB based on the following article: http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp Right now, I saved images without any...
3
by: rigamonk | last post by:
Is there a way to save richtext from a richtextbox into an access DB using vb.net? thanks patrick
2
by: Lee | last post by:
Hi, When reading a number richtext strings back from a database c# adds the @ operator to the string, the effect being all the control characters are ignored and the string cannot be added to a...
2
by: jessDMiller | last post by:
I have no clue why the data from the form isn't saving into the database. What am I doing wrong? addAnnounce.php: <td align=top> <form action="index2.php" method="post">Heading:<br...
17
dbanning
by: dbanning | last post by:
I am trying to save the contents of a form as a bitmap and am unsure how to do this. I can use the savepicture command to save the form as a bitmap but the contents is not intact as you would expect....
0
by: giddy | last post by:
hi , i made a little RtfEncapsulator. Its a class thats called RichText , it has an RtfElementCollection which takes any class that exposes the IRtfElement interface. I managed to make an...
2
by: RobcPettit | last post by:
Hi, I need some advice on how to proceed with saving gridview contents. Ive got a 'datagridview control' on a form, so its window application only not web. I fill this programatically with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.