And then I execute the TestSaveLoadDb() function, it add a line in my table Blank.doc in Name field but Nothing (any document ) is inserted in Data field.
Blank.doc is located in Documents\Testing in my server.
You have done correctly when commented those lines, they’re for testing purposes only. But it is strange that you haven’t achieved the appropriate result. I’ve just tested this sample and it has worked fine (put the document into the database and extracted it).
Please make sure that you have created a table named Documents with two fields Name (string) and Data (OLE Object in MS Access).
As additional steps, check again the paths to the document and to the db file. Check the connection string. Trace the code, make sure that the byte array is properly filled when inserting the document into the db.
No. The Assertion class is a part of the NUnit testing framework and was included for testing purposes only. Therefore the solution is just removing or commenting it as I have already said.
Sorry that the code example we posted in the forums did not compile for you straight away. This code example was copied and pasted from production code without proper preparation to make it friendly to all users.
We use NUnit for unit testing and Assertion is a class in that library. You do not need this to run the code example and you were simply expected to delete or comment out the lines that do not compile (there is only one or two lines like this in the example).
Please note that some of the code examples posted in the forums previously may contain references to Assertion class and all these lines should be deleted or commented out.
Sorry it caused you confusion, but we considered it is such a simple issue that does not warrant any attention and we never had any questions from other users about this.