|
yakker
4 posts
 Popping In
|
14-12-2009 20:40
Has anyone had any success with this book yet?
I am having trouble compiling the C# programs. For instance Chapter2 Listing 4., this 'complete program listing' when trying to build gives error "does not contain a static 'Main' method suitable for an entry point".
Now is it me, or is the program listing incorrect?
|
|
yakker
4 posts
 Popping In
|
18-12-2009 18:42
Hooray, After following the text instructions carefully from the book to build the form, then downloading the program CH02listing4.cs and using this as the form1.cs program. It then built okay with no errors, but still would not work.
As Elektor did not respond to my query as to why this program would not work, I have persevered and found the answer.
The problem was that I needed to select form1.cs(design) and under properties click the event button (the lightening bolt) select load, and add Form1_load. Then I needed to select the button on the form, and again under properties, events, select click, and call startButton_click. Repeat for the other buttons, and hey presto the example works.
This problem would have been solved easily but for a few extra lines in the book, rather than assume we are C# experts.
|
|
yakker
4 posts
 Popping In
|
30-12-2009 15:36
On page 56 the author suggests a password of "mypassword", if you use your own password, you will need to edit 'form1.cs' to reflect your own password.
On page 62, the "empty table" button is called the "clearButton" but this is wrong, it should be the "dropButton".
The author suggests you may create a new table "results" in the database, if you do this before running the program, then 'create
table' causes an alarm as you will have already created the table.
|
|
barmed
3 posts
 Popping In
|
04-04-2012 05:27
Hi
Thanks very much for that info because I was trying for hours to get my start button to work which didnt because I did not go into event and load form. BTW a useful line for previous example in this book is
Control.CheckForIllegalCrossThreadCalls = false;
put it above
initialize components ();
As it got rid of an exception handler issue. I agree I think this author should raelise her code if you just do whts in the book doesn't work
|