Hi Trent,
Thanks for your reply, let me explain this better...
1)
I have a stored procedure named XML_MenuOptions which returns the XML file with the correct format. The fields Tip and Comment are NVARCHAR type and contains RTF data from an SF RTF control. Here is the SP.
SELECT
dbo.ServiceOptions.ServiceOption,
dbo.ServiceOptions.DisplayOptionOrder,
dbo.SearchOptions.SearchOption ,
dbo.SearchOptions.DisplayOptionOrder,
dbo.SearchCategories.SearchCategory,
dbo.SearchCategories.DisplayOptionOrder,
dbo.SearchCategories.Comment,
dbo.SearchCategories.Tip
FROM
dbo.ServiceOptions
INNER JOIN dbo.SearchOptions
ON dbo.ServiceOptions.ServiceOptions_PK=dbo.SearchOptions.ServiceOptions_FK
INNER JOIN dbo.SearchCategories
ON dbo.SearchOptions.SearchOptions_PK = dbo.SearchCategories.SearchOptions_FK
ORDER BY dbo.ServiceOptions.DisplayOptionOrder,dbo.SearchOptions.DisplayOptionOrder,dbo.SearchCategories.DisplayOptionOrder
FOR XML AUTO , ROOT('services')
2)
I created an Scalar function in a BO (see code below) to execute the SP and returns the XML file from as string. I noticed the following when executing the scalar function:
a) If the RTF fields "Tip and Comment" are included, then the string returned is not completed rendering the XML file invalid.
Public Function GetXMLMenuOptions() As String
Dim cmd As New SqlCommand()
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "dbo.XML_MenuOptions"
Return CType(Me.ExecuteScalar(cmd), String)
End Function
b) If the RTF fields are excluded, then the string returned is completed and the XML file is OK.
c) If the RTF fields are included, and I limit the records to show using a WHERE condition, then the string returned is completed and the XML file is OK.
At this point, I could say that there should be a problem with the amount of characters that can be returned by the Scalar function. Do you have any suggestion on this regard?
Thanks,
Doron