Still trying to test clases

Firstly - sorry to Mitja and kimbokasteniv who replied to this question a few days ago. I know your answers are correct, and I thought I understood but I don't. Or at least I don't know how
to apply what you have said. My fault.
Both my brain and my bottom have gone numb through staring at this for so long!
I wish that was a joke:icon_eek:http://www.daniweb.com/software-development/csharp/threads/360517

I know that the class form and the sql it contains should be able to return all the data from the database but I don't 'get' how to make the test
form relate to the class form and return that data. I have tried to pass the schedledEvent variable to the test form but keep getting errors!
If I make the button clicks public and pass the ScheduledEventID for example I get event handler errors.
I am probably doing something basic wrong.

Whilst I recognise I am not very good at this - I am determined not to give up ... so would be grateful for any more help.

Thank you ... John.

My question again,

I have an assignment to build the booking and payment part of a Thearte Booking System. I have four classes linked to an MDF database.

The first thing that I have to do is test the classes on a test form.
I have put the SheduledEvents class at the bottom of the post.

Well what you have looks fine, I just don't see any code which would take the information you got from the database and make it visible to the user... at least not in your btnGetAScheduledEvent_Click method.

Once you call the GetEventByID method of currentEvent, currentEvent should have data in its properties (assuming your database was there, and the event id matched an event).
So, you can get the data from currentEvent, by calling each property. For instance:

myOutputTextBox.Text = currentEvent.EventName

I think that was part of your problem? You were asking how to present the data back to the user?

As for getting data into the listBox, that's going to be different. I never done it in c#, but if you look at the MSDN page for ListBox, you should see all the methods and what type of data needs to be given to each method. Or someone here can give you a quick example...

Well what you have looks fine, I just don't see any code which would take the information you got from the database and make it visible to the user... at least not in your btnGetAScheduledEvent_Click method.

Once you call the GetEventByID method of currentEvent, currentEvent should have data in its properties (assuming your database was there, and the event id matched an event).
So, you can get the data from currentEvent, by calling each property. For instance:

myOutputTextBox.Text = currentEvent.EventName

I think that was part of your problem? You were asking how to present the data back to the user?

As for getting data into the listBox, that's going to be different. I never done it in c#, but if you look at the MSDN page for ListBox, you should see all the methods and what type of data needs to be given to each method. Or someone here can give you a quick example...

Thanks again kimbokasteniv ... with your help, I at least know that the database is there for sure and returns the Events by ID in a textbox. Part of my problem was due to messing around with the form and code so much, I had got everything a bit mixed up:confused:. I started again with the form, added the buttons and code again, and it now makes sense.

I didn't think it would be difficult to get the data to show in the list box, but it is not as straight forward as I expected - but I will persist.