I am loading the 5 checkboxlist from a database. I have 5 lists. The first
four are interior, exterior, safety and drive train. The fifth is optional
options. It is possible the optional option was already selected, if it was
selected it would be in one of the first four (interior, exterior, safety and
drive train). What I am doing is loading the fifth checkboxlist and then
checking to see if it was selected if so, I am trying to remove it from the
fifth checkboxlist. This is my code.
This first four are
CREATE PROCEDURE Get_A_Vin_A_CarOptions_by_type
@Vin Nvarchar(50),
@IdTypeOption int
as
SELECT Options.IdTypeOption, Options.PrintDescription, Options.IDOption
FROM VinNumber INNER JOIN
Options ON VinNumber.VINOption =
Options.OptionDescription AND VinNumber.VINValue = Options.OptionValue
WHERE VinNumber.VIN = @Vin AND (VinNumber.VINOption NOT LIKE 'decoded'
+ '%') AND (VinNumber.VINOption NOT LIKE 'DataOne' + '%')
AND (VinNumber.VINOption NOT LIKE 'vinSquish' + '%')
AND (NOT (Options.PrintDescription IS NULL)) and Options.IdTypeOption
=@IdTypeOption
ORDER BY Options.PrintDescription
GO
The fifth one is
CREATE PROCEDURE Get_A_Vin_A_CarOptions
@Vin Nvarchar(50)
as
SELECT Options.IdTypeOption, Options.PrintDescription, Options.IDOption
FROM VinNumber INNER JOIN
Options ON VinNumber.VINOption =
Options.OptionDescription AND VinNumber.VINValue = Options.OptionValue
WHERE VinNumber.VIN = @Vin AND (VinNumber.VINOption NOT LIKE 'decoded'
+ '%') AND (VinNumber.VINOption NOT LIKE 'DataOne' + '%')
AND (VinNumber.VINOption NOT LIKE 'vinSquish' + '%')
AND (NOT (Options.PrintDescription IS NULL))
ORDER BY Options.IdTypeOption, Options.PrintDescription
GO
Editoptionalsselected.DataSource =
optionsfile.GetACarOptionoptionals(DataTableCars.R ows(0)("VinNumber"))
Editoptionalsselected.CellPadding = 5
Editoptionalsselected.DataTextField = "PrintDescription"
Editoptionalsselected.DataValueField = "IDOption"
Editoptionalsselected.RepeatColumns = 5
Editoptionalsselected.RepeatDirection = RepeatDirection.Horizontal
Editoptionalsselected.CssClass = "CartListItem"
Editoptionalsselected.BackColor = Yellow
If DataTableCars.Rows(0)("IdCar") > 0 Then
OptionsSelected =
optionsfile.GetACarOptions(DataTableCars.Rows(0)(" IdCar"))
While OptionsSelected.Read()
selected = OptionsSelected.Item("IdOption")
Editoptionalsselected.Items.Remove(selected)
End While
End If
Editoptionalsselected.DataBind()