J
Jon Delano
Hello all
This is normally an easy error to fix.
The creation of the object was done correclty.
I have an object that I am using and have been using. Suddenly yesterday I
get this error using it.
I have inregistered the DLL deleted the DLL and copied it from the source
and then re-registered it. Same issue.
I removed the reference from my web app and then added the reference back,
same issue.
Its like the function ParseString has an object in it that isn't being
created properly ... but this worked yesterday just fine.
Until I changed from using an UPDATE query to using a stored procedure
(which should have no berring at all).
I'm stumped. Any ideas at all would be greatly helpful.
Thanks
Jon
Here is the code:
' find the dictations edited in the portal, clean the HTML just
incase it has MS Word stuff in it.
Dim cn As New
SqlConnection(ConfigurationSettings.AppSettings("RepositoryConnectionString"))
Dim cn1 As New
SqlConnection(ConfigurationSettings.AppSettings("RepositoryConnectionString"))
cn.Open()
cn1.Open()
Dim TidyDOC As Tidy.Document (THIS IS THE OBJECT I AM USING)
**************************
Dim eCode As Int16
Dim newTranscript As String
Dim cmdGetDictations As New SqlCommand("select patientdictationid,
isnull(transcript,'') as transcript from tblPatientDictation where
PortalEdit=1", cn)
Dim rdrGetDictations As SqlDataReader =
cmdGetDictations.ExecuteReader
Dim cmdWriteDictation As SqlCommand
Dim intResult As Int16
Dim DictText As String
Dim UpdateCount As Int16
Do While rdrGetDictations.Read
TidyDOC = New Tidy.Document <-------- i do a NEW to create
the object
Try
DictText = rdrGetDictations("transcript")
TidyDOC.SetOptBool(TidyATL.TidyOptionId.TidyWord2000, 1)
TidyDOC.SetOptBool(TidyATL.TidyOptionId.TidyHtmlOut, 1)
eCode = TidyDOC.ParseString(DictText) <----- i
get the obj ref not set here. .. after its been ref twice before this line
...
eCode = TidyDOC.CleanAndRepair
TidyDOC.SetOptBool(TidyATL.TidyOptionId.TidyForceOutput, 1)
newTranscript = TidyDOC.SaveString
newTranscript = newTranscript.Replace("'", "''")
newTranscript = newTranscript.Replace(Chr(34), "''")
cmdWriteDictation = New SqlCommand("spUpdateDictation", cn1)
cmdWriteDictation.CommandType = CommandType.StoredProcedure
cmdWriteDictation.Parameters.Add("@Dictation",
newTranscript)
cmdWriteDictation.Parameters.Add("@DictationID",
rdrGetDictations("patientdictationid"))
intResult = cmdWriteDictation.ExecuteNonQuery
cmdWriteDictation.Dispose()
UpdateCount += 1
Catch ex As Exception
Exit Do
End Try
TidyDOC = Nothing
Loop
cmdGetDictations.Dispose()
cmdGetDictations = Nothing
rdrGetDictations.Close()
rdrGetDictations = Nothing
cmdWriteDictation = Nothing
cn.Close()
cn = Nothing
cn1.Close()
cn1 = Nothing
lblUserMessage.Text = "updated : " & UpdateCount
lblUserMessage.Visible = True
This is normally an easy error to fix.
The creation of the object was done correclty.
I have an object that I am using and have been using. Suddenly yesterday I
get this error using it.
I have inregistered the DLL deleted the DLL and copied it from the source
and then re-registered it. Same issue.
I removed the reference from my web app and then added the reference back,
same issue.
Its like the function ParseString has an object in it that isn't being
created properly ... but this worked yesterday just fine.
Until I changed from using an UPDATE query to using a stored procedure
(which should have no berring at all).
I'm stumped. Any ideas at all would be greatly helpful.
Thanks
Jon
Here is the code:
' find the dictations edited in the portal, clean the HTML just
incase it has MS Word stuff in it.
Dim cn As New
SqlConnection(ConfigurationSettings.AppSettings("RepositoryConnectionString"))
Dim cn1 As New
SqlConnection(ConfigurationSettings.AppSettings("RepositoryConnectionString"))
cn.Open()
cn1.Open()
Dim TidyDOC As Tidy.Document (THIS IS THE OBJECT I AM USING)
**************************
Dim eCode As Int16
Dim newTranscript As String
Dim cmdGetDictations As New SqlCommand("select patientdictationid,
isnull(transcript,'') as transcript from tblPatientDictation where
PortalEdit=1", cn)
Dim rdrGetDictations As SqlDataReader =
cmdGetDictations.ExecuteReader
Dim cmdWriteDictation As SqlCommand
Dim intResult As Int16
Dim DictText As String
Dim UpdateCount As Int16
Do While rdrGetDictations.Read
TidyDOC = New Tidy.Document <-------- i do a NEW to create
the object
Try
DictText = rdrGetDictations("transcript")
TidyDOC.SetOptBool(TidyATL.TidyOptionId.TidyWord2000, 1)
TidyDOC.SetOptBool(TidyATL.TidyOptionId.TidyHtmlOut, 1)
eCode = TidyDOC.ParseString(DictText) <----- i
get the obj ref not set here. .. after its been ref twice before this line
...
eCode = TidyDOC.CleanAndRepair
TidyDOC.SetOptBool(TidyATL.TidyOptionId.TidyForceOutput, 1)
newTranscript = TidyDOC.SaveString
newTranscript = newTranscript.Replace("'", "''")
newTranscript = newTranscript.Replace(Chr(34), "''")
cmdWriteDictation = New SqlCommand("spUpdateDictation", cn1)
cmdWriteDictation.CommandType = CommandType.StoredProcedure
cmdWriteDictation.Parameters.Add("@Dictation",
newTranscript)
cmdWriteDictation.Parameters.Add("@DictationID",
rdrGetDictations("patientdictationid"))
intResult = cmdWriteDictation.ExecuteNonQuery
cmdWriteDictation.Dispose()
UpdateCount += 1
Catch ex As Exception
Exit Do
End Try
TidyDOC = Nothing
Loop
cmdGetDictations.Dispose()
cmdGetDictations = Nothing
rdrGetDictations.Close()
rdrGetDictations = Nothing
cmdWriteDictation = Nothing
cn.Close()
cn = Nothing
cn1.Close()
cn1 = Nothing
lblUserMessage.Text = "updated : " & UpdateCount
lblUserMessage.Visible = True