Re: Cor..

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Varun (anonymous_at_discussions.microsoft.com)
Date: 02/16/04


Date: Mon, 16 Feb 2004 13:56:09 -0800

Hello Cor,

thank you for responding to my help call.

My data is coming from an sql server database

>>Why are you showing the date if you know that you cannot use it?
The date is selected using a datetimepicker. It is need as the user can book another carmake for the same day. i.e even if they already book a ford car they can still book a Skoda for the same day.

>>What is the dataformat.
The date is in a dateTime format (short date)
CarMake is a varchar(30)
CarReg is VarChar(7)

Date is first selected using the dateTimePicker
Carmake is then selected using a datareader from database (Combobox)
CarRegistration is then displayed based on the carMake selected. (Combobox)

i.e if Porsche 911 is selected registration xxx xxxx and yyy yyyy is shown in the CarRegistration combobox
if Ford escort is selected registartion aaa aaaa and bbb bbbb and ccc cccc is shown

the user then go through each combobox and select the approapraite car.
Lets say Porsche 911 xxx xxxx was hired for 1/1/2004
They then click add button and the values are moved to my datatable. and all comboboxes are reset

The problem i get is that when user goes back to make another hire and selects the same date and carmake again, (i.e. they select Porsche 911 and date 1/1/2004, the reg xxx xxxx is stil shown again which allows them to book same car again and cause duplicate row in my datatable. The application then crashes.
The reason it does this is beacause the database has no knowledge that Porsche 911 xxx xxxx was hired for 1/1/2004 as this is all done in my dataset. The values retrieved for my combox are from the database. This is why i wish to remove this registration from the combobox based on the date and carmake.

Does this make any more sense?
My wording is not too good. :)


Quantcast