Rich text from sql database

D

David Barrett

Hi,

I'm developing using InfoPath 2007 in Visual Studio 2005 (c#). I'm trying to
save the contents of a form's rich text box to an SQL Server 2005 database.
I've managed this by saving the rich text box's xml to a text field.

Now I want to retrive that xml from the text field in my sql database and
display it in my infopath form. At the moment I can only get the xml to
display using:

nav.SelectSingleNode("/my:myFields/my:fldRichText",
this.NamespaceManager).SetValue(Convert.ToString(thisReader["fldFormRichText"]));

How can I get the rich text xml translated into rich text and displayed on
my form.

Any help would be greatly appreciated.
Thanks
 
S

S.Y.M. Wong-A-Ton

When saving to the database, retrieve the contents of the Rich Text Box using
the InnerXml property of the field. When retrieving from the database, set
the InnerXml property of the field instead of using the SetValue method of
the field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top