Repository navigation
System.InvalidCastException error #99
Description
Activity
Looks like you have a doc that has an item named "Form" and the value is not a string.
Reacted by Virtute90Hi UziTech
I have the same error message. I tried to export a Notes standard nsf: log.nsf
Unfortunately, I don't understand what exactly you mean by your reference to the error.
All documents have a text entered in the field/item form in the log.nsf.All I did was read the error. Unless you can send me the nsf file I can't help debug more than that.
Thank you for your quick response.
I have just found out the following.
If I use an empty NSF file, no error is displayed.
But as soon as I use an NSF with documents, this error is displayed.
In every Notes document there is the field "Form". If I delete this field in the document, the error is not displayed.
An export.sql file is generated. As far as I can tell, it only contains the instructions for creating the table, not any data records.
Maybe that will help you. Otherwise have a nice weekend and see you on Monday.Hi Tony
Here is some detailed information with files.
It may help you with troubleshooting.I created a new nsf file and created a document there.
I then tried to export this to a file.==> Screenshot error-notebook.jpg
Then I deleted the "Form" field in the document and tried again
- content of the field Form ==> error_notebook-Form.jpg
- delete the Form field and export it again ==> error_notebook-afterdeleteForm.jpg
Now you will be asked whether Server or File ==> File is selected - the following file was created ==> exportnotebook.sql
Enclosed is also the NSF file that I used for this. The Form field is deleted in the document.
I hope it helps you.Unfortunately I no longer have a computer with lotus notes installed so it seems I can't even open .nsf files.
The "Form" is used as the table name and it is assumed to be a
string[]. In #101 I changed it to check the type or just use the table name"table"as a default.See if this fixes the issue for you: NSF2SQL.next.zip
- Hi Tony Leider klappt es auch mit der neuen Version nicht. Hier erhalte ich den Fehler ***@***.*** Translated System.InvalidCastException: The object of type "System.ObjectD" cannot be converted to type Domino.Notesitem@<mailto:Domino.Notesitem@>. With NSF2SQL.Form1.<>c_DisplayClass15_0.«bExportDocuments_Click>b_0 (Object dialog, DoWorkEventArgs e) in C:\Users\tony\Documents\GitHub\nsf2sqNNSF2SQL\Form1.cs:Zeile 411. Since I don't know what you changed in line 399 in Form1.cs, I can't see what is wrong in line 411. The nsf file I sent you is a Notes standard database. Which database did it work with back then? Mit freundlichen Grüßen / Best regards Dirk Wedemeyer | CGI | Senior Consultant CGI Deutschland B.V. & Co.KG Heesenstraße 31| 40549 Düsseldorf | Germany M: +49 170 8532313 Mail: ***@***.******@***.***> | de.cgi.com<https://www.cgi.com/de> Chat with me via ***@***.***> Von: Tony Brix ***@***.***> Antworten an: UziTech/NSF2SQL ***@***.***> Datum: Dienstag, 25. Juni 2024 um 08:58 An: UziTech/NSF2SQL ***@***.***> Cc: Dirk Wedemeyer ***@***.***>, Comment ***@***.***> Betreff: Re: [UziTech/NSF2SQL] System.InvalidCastException error (Issue #99) EXTERNAL SENDER: Do not click any links or open any attachments unless you trust the sender and know the content is safe. EXPÉDITEUR EXTERNE: Ne cliquez sur aucun lien et n’ouvrez aucune pièce jointe à moins qu’ils ne proviennent d’un expéditeur fiable, ou que vous ayez l'assurance que le contenu provient d'une source sûre. Unfortunately I no longer have a computer with lotus notes installed so it seems I can't even open .nsf files. The "Form" is used as the table name and it is assumed to be a string[]. In #101<https://urldefense.com/v3/__https:/github.com/UziTech/NSF2SQL/pull/101__;!!AaIhyw!obMTt3_QE-26L42pkTog2OCdGCFk_4UeIzcxB1JqMckoA4NGYF5PRdMw1-IQWIc1igu_Rf84kSOLH0XJfwb5REuUKUk$> I changed it to check the type or just use the table name "table" as a default. See if this fixes the issue for you: NSF2SQL.next.zip<https://urldefense.com/v3/__https:/github.com/user-attachments/files/15966249/NSF2SQL.next.zip__;!!AaIhyw!obMTt3_QE-26L42pkTog2OCdGCFk_4UeIzcxB1JqMckoA4NGYF5PRdMw1-IQWIc1igu_Rf84kSOLH0XJfwb58SssmPE$> — Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https:/github.com/UziTech/NSF2SQL/issues/99*issuecomment-2188126850__;Iw!!AaIhyw!obMTt3_QE-26L42pkTog2OCdGCFk_4UeIzcxB1JqMckoA4NGYF5PRdMw1-IQWIc1igu_Rf84kSOLH0XJfwb5B3cSNrU$>, or unsubscribe<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/BJLQ6LGP3LT4J5XN5XHXXCTZJEIIDAVCNFSM6AAAAABGM5W4J2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBYGEZDMOBVGA__;!!AaIhyw!obMTt3_QE-26L42pkTog2OCdGCFk_4UeIzcxB1JqMckoA4NGYF5PRdMw1-IQWIc1igu_Rf84kSOLH0XJfwb50E9mGdI$>. You are receiving this because you commented.Message ID: ***@***.***>
- marked This is the error I'm encountering: System.cast.exception. #112 as a duplicate of this issue
on Jun 21, 2025 see if v0.4.1 fixes it. It seems like the nsf file is corrupt but at least the fix should give a different error. A common theme in this type of error is that English is not the language used. It may be that "Form" field is a different word in other languages?



I encounter this error when I try to export documents
How can I solve it?