Link to home
Start Free TrialLog in
Avatar of T Hoecherl
T HoecherlFlag for United States of America

asked on

Passing checklist to SQL stored procedure

I have a vb.net program that has a checked list box.  When the program is run, the user can select one or more of the batches that are listed in the box.  The program then runs and includes this code:

cmd.CommandText = "UPDATE PCT_PROD_BATCHING SET STATUS = 2, DATETIME_BATCHED = '" & dtDate & "' WHERE BATCH_NUMBER IN (" & String.Join(",", clbBatches.CheckedItems) & ")"
        cmd.ExecuteNonQuery()

I get this error:

The multi-part identifier "System.Windows.Forms.CheckedListBox" could not be bound.
Invalid column name 'CheckedItemCollection'.

I have used this same code in other applications and it has worked, but it is not working here.  How can I correct the problem?
ASKER CERTIFIED SOLUTION
Avatar of Máté Farkas
Máté Farkas
Flag of Hungary image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial