473,388 Members | 1,600 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,388 software developers and data experts.

Insert rich text box into database

I have a rich text box that I want to 'insert' into my SQL2K db. But I'm
not sure how to handle it. Do I convert it to XML first? Do I place the
rich text box in an object then insert it as a binary object?

thanks.
Nov 15 '05 #1
1 10326
Do you need to save the rich text box itself, or just the _contents_ of the
box? (I.e., the formatted text.)

Assuming you just want to persist the contents of the box, simply retrieve
the .Rtf property from the richtextbox. It returns a string that contains
the text of the contents, along with embedded formatting codes. (It's
similar to HTML.) Save that string into the database. To restore the box,
do the opposite -- retrieve the string and assign it to the box's .Rtf
property.

If you need to persist the entire box -- its dimensions, contents, etc. --
you could possibly serialize the box to a string that you can then save in
your database, and then later deserialize that string into a box later on.
That's a good deal more complicated though, and hopefully unnecessary.
"Jim P." <tr**********@yahoo.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
I have a rich text box that I want to 'insert' into my SQL2K db. But I'm
not sure how to handle it. Do I convert it to XML first? Do I place the
rich text box in an object then insert it as a binary object?

thanks.

Nov 15 '05 #2

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

Similar topics

3
by: Alfredo Agosti | last post by:
Hi folks, I have an Access 2000 db with a memo field. Into the memo field I put text with bold attributes, URL etc etc What I need to to is converting the rich text contained into the memo...
3
by: Rich Wallace | last post by:
Hi all, I've been though many posts in this group and have yet to find one that helps me understand how to accomplish my goal. I have an XML document that stores user specific values that I...
0
by: raj | last post by:
Hello , I have a problem, rich text bullets are not displayed in Crystal report. Environment : VS .NET 2003 CrystalDecisions.CrystalReports.Engine Version 9.1.5000.0 ( it came with ..NET...
20
by: Guadala Harry | last post by:
In an ASCX, I have a Literal control into which I inject a at runtime. litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID); This works great as long as the contains just...
2
by: Rich | last post by:
Hello, I have an oleDBDataAdapter (da1) which gets data from an Access mdb and fills a dataset (ds1) with integer data from "tbl1" in Access. Data displays in textboxes on a form. The...
4
by: Al | last post by:
Hi, Is there any way to insert LinkLabel in rich text box? Or hyperlink a text in rich text box? Thanks Al
16
by: Neil | last post by:
I posted a few days ago that it seems to me that the Access 2007 rich text feature does not support: a) full text justification; b) programmatic manipulation. I was hoping that someone might...
4
by: =?Utf-8?B?UmljaA==?= | last post by:
On a form - I have a datagridview which is docked to the entire form. The datagridview allows users to Delete and/or Add Rows. On the Form_Load event I Fill the datagridview source table with a...
13
by: Terry Olsen | last post by:
I'm using OleDb to connect with an Access Database. I have anywhere from 10 to over 100 records that I need to either INSERT if the PK doesn't exist or UPDATE if the PK does exist, all in a single...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.