• 0

Deitel C# Fig. 19.15 ReadSequentialAccessFileForm.cs


Question

Like I have said many times before: ?It ant the Bolt it is the Monkey working it that is the problem!?

Frustrated that I could not get Example 19.15 to work I moved on to the homework assignments.

Exercise 19.3 ? 19.4 in Deitel and Deitel?s ?Visual C# 2008 how to Program Third Edition? has you build

a simple data base Window Form App. That is where I found my mistake. I had simply mist modifying the

overloaded constructor in RecordSerializable.cs as I was just lazily modifying the Record class

Fig. 19.8 in stead of moving Fig. 19.13 RecordSerializable.cs in to my DLL build.

Changed

public Record(....

To

public RecordSerializable(...

and it all works now

Thanks Bright Star for the help.

Has anyone had that problem running this example?

It is in Visual C# 2008 how to Program. pg. 955.

RecordSerializable record = ( RecordSerializable ) reader.Deserialize( input );

The exception "SerializationException" is thrown when an error occurs during serialization or deserialization.

"input" has the file open for reading, I can see it in the Debugger.

Thanks MikeA.

ps. please do not tell me to put the DLL, the EXE, and the Data file all in the same directory, that is just Voodoo.

Edited by MikeA
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

What is the message and stack trace that accompanies that exception?

In fact, according to the code sample (and a bad one at that), here, the exception will be thrown if either the data could not be deserialised, (so question 1: was it serialised properly?), and 2 if it reaches the end of the file.

Link to comment
Share on other sites

  • 0

Hi Bright Star

Like I have said many times before: ?It ant the Bolt it is the Monkey working it that is the problem!?

Frustrated that I could not get Example 19.15 to work I moved on to the homework assignments.

Exercise 19.3 ? 19.4 in Deitel and Deitel?s ?Visual C# 2008 how to Program Third Edition? has you

build a simple data base Window Form App. That is where I found my mistake. I had simply mist

modifying the overloaded constructor in RecordSerializable.cs as I was just lazily modifying the Record class

Fig. 19.8 in stead of moving Fig. 19.13 RecordSerializable.cs in to my DLL build.

What is the message and stack trace that accompanies that exception?

In fact, according to the code sample (and a bad one at that), here, the exception will be thrown if either the data could not be deserialised, (so question 1: was it serialised properly?), and 2 if it reaches the end of the file.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.