Click here to Skip to main content
15,925,444 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionLocking/Freezing every thing while running .aspx application???? [modified] Pin
avols14321-May-08 3:53
avols14321-May-08 3:53 
AnswerRe: Locking/Freezing every thing while running .aspx application???? Pin
eyeseetee21-May-08 4:07
eyeseetee21-May-08 4:07 
AnswerRe: Locking/Freezing every thing while running .aspx application???? Pin
keyboard warrior21-May-08 5:34
keyboard warrior21-May-08 5:34 
GeneralRe: Locking/Freezing every thing while running .aspx application???? Pin
eyeseetee21-May-08 21:36
eyeseetee21-May-08 21:36 
GeneralRe: Locking/Freezing every thing while running .aspx application???? Pin
keyboard warrior23-May-08 10:42
keyboard warrior23-May-08 10:42 
Questionsubscript and superscript in textbox Pin
saud_a_k21-May-08 3:35
saud_a_k21-May-08 3:35 
AnswerRe: subscript and superscript in textbox Pin
Sam Xavier21-May-08 7:53
Sam Xavier21-May-08 7:53 
QuestionFound a low surrogate char without a preceding high surrogate at index: 367 ... Pin
RAO KAMRAN ANWAR21-May-08 1:56
RAO KAMRAN ANWAR21-May-08 1:56 
Hi,

I am working on maintenance of an ASP .Net application built in F/W 1.1. I am having the following error while calling fucntion in business class that uses dlls "Interop.HTML2RTF.dll" & "Html2Rtf.dll" following is the function call and called function:

ERROR: Found a low surrogate char without a preceding high surrogate at index: 367. The input may not be in this encoding, or may not contain valid Unicode (UTF-16) characters. Parameter name: chars

Can somebody help me in this regard?

Rao Kamran

Here is the Code:
-----------------------------------------------------------------------
CALL:
------

Dim a, b, c As String

a = System.Convert.ToString(RTrim(FPCN_Number))

b = System.Convert.ToString(namesArray(i))

c = System.Convert.ToString(lsFileDirectory)

retval = bsvSingleRTF.Generate_Blanket_RTF_Sngle(a, b, c)

FUNCTION BEING CALLED:
----------------------

Public Function Generate_Blanket_RTF_Sngle(ByVal asFPCNNumber As String, ByVal asParentEndName As String, ByVal lsFileDirectory As String) As Integer

Dim aParam(0) As SqlParameter

Dim ldr As SqlDataReader

Dim retVal As Integer = 0

'supplied as parameters

Dim FPCNnumber As String = asFPCNNumber

Dim ParentEndName As String = asParentEndName

lsFileDirectory = lsFileDirectory





Dim FPCNRegistration As New bsvFPCNRegistration

Dim registrationDataset As bsvFPCNRegistrationData

Dim FPCNAPCNRegistration As New bsvFPCNUseAPCNRegistration

FPCNAPCNRegistration.of_GetTopMarkingList(asFPCNNumber)



registrationDataset = FPCNRegistration.of_GetByFPCNNumber(FPCNnumber)

registrationDataset.Merge(FPCNRegistration.of_GetCustomerLetterByFPCNNumber(FPCNnumber))

'Do all Declarations here

Dim asSubject As String = ""

Dim asFPCNDate As DateTime

Dim asImplementationDate As DateTime

Dim asSamDate As DateTime

Dim asSamDateDisplay As String = ""

Dim asProducts As String = ""

Dim asFPCN_Number As String = ""

Dim asDescription As String = ""

Dim asReason As String = ""

Dim asReasonForChange = ""

Dim asImpact As String = ""

Dim asBUQAEng As String = ""

Dim asBUQAEngEmail As String = ""

Dim asOriginator As String = ""

Dim asEmailAddress As String = ""

Dim asDescriptionOfChange As String = ""

Dim asCustomerResponse1 As String = ""

Dim asCustomerResponse2 As String = ""

Dim topReader As SqlDataReader

'Get ToSideMarking

topReader = FPCNAPCNRegistration.of_FPCN_Get_IP_TM_TCL(asFPCNNumber, asParentEndName)

'asFPCNDate = registrationDataset.Registration(0).created

If registrationDataset.Customer_Letter.Count > 0 Then

With registrationDataset.Customer_Letter(0)

Dim dataRow() As dataRow = registrationDataset.Personnel.Select(String.Format("Personnel_ID = '{0}'", registrationDataset.Registration(0).prod_eng_Personnel_ID))

If dataRow.Length > 0 Then

asBUQAEng = String.Format("{0} {1} ", dataRow(0)("first_name"), dataRow(0)("last_name"))

asBUQAEngEmail = dataRow(0)("email_address")

End If

asFPCNDate = .letter_dispatch_date

Dim h As New HTML2RTF.Converter

h.OutputTextFormat = HTML2RTF.eOutputTextFormat.Rtf

asSubject = .subject

asImplementationDate = .implementation_date

'asProducts = Replace(FPCNAPCNRegistration.of_FPCN_Get_Distinct_TM_For_Parent_End_CSV(asFPCNNumber, asParentEndName), ",", ", ") 

While topReader.Read()

If IsDBNull(topReader("Marketing_Part")) Then

asProducts = ""

Else

asProducts = asProducts + topReader("Marketing_Part") + ","

End If

End While

asProducts = removeDupsArray(asProducts) 

asProducts = Replace(asProducts, ",", ", ")



asFPCN_Number = FPCNnumber

If Not IsDBNull(.body) OrElse .body.Trim() <> "" Then asDescription = replaceLicense(h.Convert(Replace(.body, vbCrLf, "<br>")))

Try

If .sample_availability_date <> "" And Not IsDBNull(.sample_availability_date) Then

If IsDate(.sample_availability_date) Then

asSamDate = .sample_availability_date

asSamDateDisplay = asSamDate.ToString("MMMMMMMMMM dd, yyyy")

Else

asSamDateDisplay = .sample_availability_date

End If

Else

asSamDateDisplay = ""

End If

Catch e As Exception

End Try

Dim errataNumber As String = ""

If Not .Iserrata_numberNull Then errataNumber = .errata_number

If .rev_change And .fab_change Then

asReason = String.Format("Update to Errata {0} and Additional Manufacturing Capacity", errataNumber)

ElseIf .rev_change Then

asReason = String.Format("Update to Errata {0}", errataNumber)

ElseIf .fab_change Then

asReason = "Additional Manufacturing Capacity"

End If

If Not IsDBNull(asReason) OrElse asReason.Trim() <> "" Then asReason = replaceLicense(h.Convert(Replace(asReason, vbCrLf, "<br>")))

If Not IsDBNull(.impact) OrElse .impact.Trim() <> "" Then asImpact = replaceLicense(h.Convert(Replace(.impact, vbCrLf, "<br>")))

If IsDBNull(.reason_for_change) Then

asReasonForChange = ""

Else

asReasonForChange = .reason_for_change

End If

If Not IsDBNull(.Originator) OrElse .Originator.Trim() <> "" Then asOriginator = replaceLicense(h.Convert(Replace(.Originator, vbCrLf, "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;")))

If Not IsDBNull(.EmailAddress) OrElse .EmailAddress.Trim() <> "" Then asEmailAddress = replaceLicense(.EmailAddress)

If Not IsDBNull(.DescriptionOfChange) OrElse .DescriptionOfChange.Trim() <> "" Then asDescriptionOfChange = replaceLicense(.DescriptionOfChange)

If Not IsDBNull(.CustomerResponse1) OrElse .CustomerResponse1.Trim() <> "" Then asCustomerResponse1 = replaceLicense(.CustomerResponse1)

If Not IsDBNull(.CustomerResponse2) OrElse .CustomerResponse2.Trim() <> "" Then asCustomerResponse2 = replaceLicense(.CustomerResponse2)

End With

Dim ls_Template As String

Dim asFileName As String

Dim ls_Templatecustomer As String

Dim fileName As String

Dim customerfilename As String



'mzia (Replcing special characters ( / \ : * ? " < > | ) in Customer name)

ParentEndName = Replace(ParentEndName, "/", "-")

ParentEndName = Replace(ParentEndName, "\\", "-")

ParentEndName = Replace(ParentEndName, ":", "-")

ParentEndName = Replace(ParentEndName, "*", "-")

ParentEndName = Replace(ParentEndName, "?", "-")

ParentEndName = Replace(ParentEndName, Chr(34), "-")

ParentEndName = Replace(ParentEndName, "<", "-")

ParentEndName = Replace(ParentEndName, ">", "-")

ParentEndName = Replace(ParentEndName, "|", "-")

ParentEndName = Replace(ParentEndName, "~", "-")

ParentEndName = Replace(ParentEndName, "!", "-")

ParentEndName = Replace(ParentEndName, "#", "-")

ParentEndName = Replace(ParentEndName, "$", "-")

ParentEndName = Replace(ParentEndName, "%", "-")

ParentEndName = Replace(ParentEndName, "^", "-")

ParentEndName = Replace(ParentEndName, "&", "-")

ParentEndName = Replace(ParentEndName, ";", "-")

ParentEndName = Replace(ParentEndName, "'", "-")

'-------------------------------------------------------------------------



' Dim ls_RTFFileName As String = Trim(lsFileDirectory) & FPCNnumber & ".RTF"

Dim ls_RTFFileName As String = Trim(lsFileDirectory) & FPCNnumber & "_" & ParentEndName & ".RTF"

'Get the File name

fileName = lsFileDirectory & "FAB_Template2.rtf"

Dim fs As New FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read)

'########## COLLECT SOURCE DOCUMENT IN TO STREAMREADER

Dim sr As New StreamReader(fs)

'read the contents into the string 

While (sr.Peek() <> -1)

ls_Template = sr.ReadToEnd()

End While

sr.Close()

'########## COLLECT SOURCE DOCUMENT IN TO STREAMREADER ##############



'''**ADDED BY EK ON 11022004

asParentEndName = Replace(asParentEndName, "~", " ")

asParentEndName = Replace(asParentEndName, "$", "\\")

asParentEndName = Replace(asParentEndName, "^", "/")



'########## START WRITING RTF BODY TEXT TO RTF DOCUMENT

ls_Template = Replace(ls_Template, "(FPCN#)", asFPCN_Number)

ls_Template = Replace(ls_Template, "(Date Requested)", asFPCNDate.ToString("MMMMMMMMMM dd, yyyy"))

ls_Template = Replace(ls_Template, "(Customer Name)", asParentEndName)

ls_Template = Replace(ls_Template, "(Change Implementation Date)", asImplementationDate.ToString("MMMMMMMMMM dd, yyyy"))

ls_Template = Replace(ls_Template, "(Sample Availability Date)", asSamDateDisplay)

ls_Template = Replace(ls_Template, "(Title)", asSubject)

ls_Template = Replace(ls_Template, "(Products)", asProducts)

ls_Template = Replace(ls_Template, "(Origin)", asOriginator)

ls_Template = Replace(ls_Template, "(Address)", asEmailAddress)

ls_Template = Replace(ls_Template, "(Description)", asDescription)

ls_Template = Replace(ls_Template, "(Change)", asDescriptionOfChange)

ls_Template = Replace(ls_Template, "(Reason)", asReason + asReasonForChange)

ls_Template = Replace(ls_Template, "(Impact)", asImpact)

ls_Template = Replace(ls_Template, "(CR1)", asCustomerResponse1)

ls_Template = Replace(ls_Template, "(CR2)", asCustomerResponse2)

'ls_Template = Replace(ls_Template, "(BU QA Admin)", asBUQAEng)

'ls_Template = Replace(ls_Template, "buqaadmin@buqaadmin.com", asBUQAEngEmail)

'ls_Template = Replace(ls_Template, "mailto:buqaadmin@buqaadmin.com", "mailto:" + asBUQAEngEmail)



'########## START WRITING RTF BODY TEXT TO RTF DOCUMENT ###############

'###### CHECK THE VALUE OF INCLUDE QUAL DATA FLAG

Dim bsvRegistration_instance As New bsvFPCNUseAPCNRegistration

Dim ldr_Include_Qual_Data As SqlDataReader

Dim Include_Flag_Value As Integer

'########### COMMENTED BY JL on 041223 

Dim strRet As String





'############# COMPLETE RTF DOCUMENT GENERATION

Dim myStream As FileStream = New FileStream(ls_RTFFileName, FileMode.Create)

Dim myWriter As System.IO.StreamWriter = New System.IO.StreamWriter(myStream)

myWriter.Write(ls_Template)

myWriter.Close()

myStream.Close()

retVal = 1

Else

retVal = 0

End If

Return retVal

End Function

AnswerRe: Found a low surrogate char without a preceding high surrogate at index: 367 ... Pin
Imtiaz Aarif21-May-08 4:01
Imtiaz Aarif21-May-08 4:01 
QuestionExpand/Collapse Panels Pin
S.Aijaz21-May-08 1:44
S.Aijaz21-May-08 1:44 
AnswerRe: Expand/Collapse Panels Pin
Christian Graus21-May-08 1:45
protectorChristian Graus21-May-08 1:45 
GeneralInfo req for UIPAB & EWorldUI Calendar Control Pin
vamsimohan2121-May-08 1:28
vamsimohan2121-May-08 1:28 
GeneralRe: Info req for UIPAB & EWorldUI Calendar Control Pin
eyeseetee21-May-08 2:22
eyeseetee21-May-08 2:22 
Questionhow to get selected value from dynamically created dropdownlistbox which is placed in placeholder Pin
vidhyap21-May-08 1:17
vidhyap21-May-08 1:17 
AnswerRe: how to get selected value from dynamically created dropdownlistbox which is placed in placeholder Pin
Christian Graus21-May-08 1:18
protectorChristian Graus21-May-08 1:18 
GeneralRe: how to get selected value from dynamically created dropdownlistbox which is placed in placeholder Pin
vidhyap21-May-08 1:50
vidhyap21-May-08 1:50 
GeneralRe: how to get selected value from dynamically created dropdownlistbox which is placed in placeholder [modified] Pin
Sandeep Akhare21-May-08 3:01
Sandeep Akhare21-May-08 3:01 
GeneralRe: how to get selected value from dynamically created dropdownlistbox which is placed in placeholder Pin
vidhyap21-May-08 17:12
vidhyap21-May-08 17:12 
GeneralRe: how to get selected value from dynamically created dropdownlistbox which is placed in placeholder Pin
vidhyap21-May-08 19:06
vidhyap21-May-08 19:06 
Questionchange datetime format Pin
venkat86_ece21-May-08 1:08
venkat86_ece21-May-08 1:08 
AnswerRe: change datetime format Pin
Christian Graus21-May-08 1:09
protectorChristian Graus21-May-08 1:09 
GeneralRe: change datetime format Pin
venkat86_ece21-May-08 1:19
venkat86_ece21-May-08 1:19 
GeneralRe: change datetime format Pin
Christian Graus21-May-08 1:22
protectorChristian Graus21-May-08 1:22 
GeneralRe: change datetime format Pin
venkat86_ece21-May-08 1:41
venkat86_ece21-May-08 1:41 
GeneralRe: change datetime format Pin
Christian Graus21-May-08 1:43
protectorChristian Graus21-May-08 1:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.