I'm trying to create an application with CheckBoxComboBox. So the user can select more than 1 item in ComboBox.
I followed this article to create this custom component for the CheckBoxComboBox tool.
CheckBox ComboBox Extending the ComboBox Class and Its Items
I have no problem with connecting the Datatable from CheckBoxComboBox.
My problem is when I select multiple items in ComboBox I'm getting a conversion error.
Conversion failed when converting the nvarchar value '415073,415072' to data type int.
But when I select 1 item and using the same query it will show the data to DataGridView.
This is my SQL Query
SELECT TOP 500 npt.ID, l.name, nt.taskname,  FORMAT(npt.reportingDate, 'MMM-dd-yyy') AS [PHT Reporting Date],  FORMAT(npt.estReportingDate, 'MMM-dd-yyy') AS [EST Reporting Date], 
npt.remarks, FORMAT(npt.startDate, 'h:mm tt') AS [PHT Start Date], FORMAT(npt.endDate, 'h:mm tt') AS [PHT End Date], FORMAT(npt.estStartDate, 'h:mm tt') AS [EST Start Date], 
FORMAT(npt.estEndDate, 'h:mm tt') AS [EST End Date], npt.duration, npt.estDuration, npt.status
FROM tbl_DT_NonProcessingTime npt
    INNER JOIN tbl_DT_NPTTask nt ON nt.ID = npt.taskID
    INNER JOIN tbl_DT_Login l ON l.workdayID = npt.workdayID
WHERE npt.workdayID IN (@workdayIDList)
    ORDER BY npt.id DESC
And this is my code to get the value of ComboBox and remove the unwanted characters and insert to a variable string.
 string split = Regex.Replace(checkBoxComboBox1.Text, "[A-Za-z ()ñ.+-]", "");
 objNPTBEL.workdayidlist = "'" + split.Replace(",", "','") + "'";
 
eg. '415073','415072'
After I got the variable I will pass that to the parameter and call the stored procedure.
I already tried this but I'm still getting conversion errors.
