![]() |
|
|
|||||||
![]() |
ASP Net - Obtaining Data Based Upon Multiple Selections From a ListBox... |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Asp.Net
Visual Studio 2003 SQL Server. Hi, I have database in Sqlserver and ListBox (Multiple Selection Mode) in my Visual Studio Webform. I wish obtain various records from My_Store_Procedure and fill dataset. I used the following code and no work: ..... Sub ChangeWhereClause(Sender As System.Object, e As System.EventArgs) Dim strWhereClause As String = "" For Each li in listbox1.Items If li.Selected Then strWhereClause &= "EmployeeID=" & li.Value & " Or " '<---------- what is wrong? End If Next If strWhereClause.Length > 0 Then strWhereClause = Left(strWhereClause, strWhereClause.Length() - 4) strWhereClause = "WHERE " & strWhereClause Dim strSql = "Select * " _ & "From My_Store_Procedure " & strWhereClause & " Order By LastName" .... In the listbox simple selection mode i used the following code: Me.SqlSelectCommand1.Parameters("@EmployeeID").Val ue = listbox1.SelectedItem.Value and work fine. In the listbox multiple selection i Tryed put: strWhereClause &= "EmployeeID=" & Me.SqlSelectCommand1.Parameters("@EmployeeID").val ue = li.Value & " Or " ' <-------------------- what is wrong? instead of: strWhereClause &= "EmployeeID=" & li.Value & " Or " ....and no work. In listbox multiselection mode: How to dealing with parameters? How to pass the parameter? "@EmployeeID". For example: @EmployeeID instead EmployeeID Thank you in advance, Adis. =?Utf-8?B?QWRpcw==?= |
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Wonderful data input with web reporting tool | freezea | Software | 0 | 09-09-2009 05:30 AM |
| Address Bus and External Data Bus Confusion | LoXodonte | A+ Certification | 1 | 04-18-2006 10:09 PM |
| Re: 7. The truth about our creator. .7 | john smith | DVD Video | 2 | 07-25-2003 03:54 AM |