Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / December 2005

Tip: Looking for answers? Try searching our database.

How save rich text field into SQL Server

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gregor Kurth - 08 Dec 2005 20:39 GMT
Hello

How save rich text field into a Microsoft SQL Server via Web-Service.

I hope somebody can help me.

Perhaps with an example.

Thanks

Gregor
Ben walters - 08 Dec 2005 21:59 GMT
Gregor,
the Rich text fields in InfoPath are stored as XHTML, you should be able to
store the value contained within as a Text or VarChar type. I recently did
this via a web service by creating a web method that accepted a string, I
then passed in the form's xml definition to the webservice and loaded that
string into an XML Document. Then I simply found the node I wanted using
xpathe and passed the value to an update sproc.

> Hello
>
[quoted text clipped - 7 lines]
>
> Gregor
Land - 09 Dec 2005 01:34 GMT
Hi.
You can check this article especially for "Rich-Text Fields" section.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_ta/h
tml/office_infopath_using_datasets.asp


Wish it help!

Nicholas

> Gregor,
> the Rich text fields in InfoPath are stored as XHTML, you should be able to
[quoted text clipped - 15 lines]
> >
> > Gregor
Gregor Kurth - 09 Dec 2005 11:45 GMT
Hi

It is very complex for me, can help you me?

I have a Webservice, there would have one sql to still integrate.

[WebMethod]
    public System.Xml.XmlNode GetXHTMLRichText()
    {
        //Create a temporary XmlDocument object to generate nodes.
        System.Xml.XmlDocument tempDocument = new System.Xml.XmlDocument();

        //Create a wrapper node for the data.  This is necessary so
InfoPath
        //correctly detects the XHTML content
        System.Xml.XmlElement theNode =
(System.Xml.XmlElement)tempDocument.CreateNode(
           System.Xml.XmlNodeType.Element, "theNode",
"http://somearbitrarynamespace/" );

        //Create a "font" element in the xhtml namespace.
        System.Xml.XmlElement theFontNode =
(System.Xml.XmlElement)tempDocument.CreateNode(
           System.Xml.XmlNodeType.Element, "font",
"http://www.w3.org/1999/xhtml" );
        theFontNode.InnerText= "Red Text";

        //Add a color attribute.
        System.Xml.XmlAttribute colorAttribute =
tempDocument.CreateAttribute(
           "color" );
        colorAttribute.Value = "#ff0000";
        theFontNode.Attributes.Append( colorAttribute );

        //Append the font node to the wrapper node
        theNode.AppendChild( theFontNode );

        //Return the wrapper element.
        return theNode;
    }

http://support.microsoft.com/kb/826996/en-us

Thanks

Gregor

> Hi.
> You can check this article especially for "Rich-Text Fields" section.
[quoted text clipped - 27 lines]
>> >
>> > Gregor
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.