我有一个具有以下条件的存储过程:
我有一个填充参数(整数)的 ListBox,以及两个 DateTimePicker 控件,我
将我的列表框值设为:
WHERE (Transaction_tbl.dtime BETWEEN @fromDate AND @toDate)
AND (Location_tbl.Locid IN (@locations))@locations
@fromDate
@toDate.
cnt = LSTlocations.SelectedItems.Count
If cnt > 0 Then
For i = 0 To cnt - 1
Dim locationanme As String = LSTlocations.SelectedItems(i).ToString
locid = RecordID("Locid", "Location_tbl", "LocName", locationanme)
list.Add(locid)
Next
End If
我想将此列表项值传递给我的存储过程...我该怎么做?
cmd23.Parameters.Add("@startDate", SqlDbType.NVarChar, 50, ParameterDirection.Input).Value= startdate
cmd23.Parameters.Add("@endDate", SqlDbType.NVarChar, 50, ParameterDirection.Input).Value = enddate
cmd23.Parameters.Add("@locations", SqlDbType.Int) ' <= ???
如何修改此代码以将多个整数标识符作为 @locations 参数传递,以便我可以在列表框中选择多个项目?