title: while passing multiple integer value together getting error
body: <p>I have a stored procedure like this:</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[T_TransactionSummary]  
   @locations integer 
  AS
      BEGIN 
  ..............
  .............
  AND (Location_tbl.Locid IN (@locations))
  </code></pre>
  
  <p>my locid field is integer<br>
  this locid coming from my listbox.if i select one item 1 locid will come.if i select 2 item 2 locid will come..<br>
  I've got a ListBox which populates the @locations parameter (an integer), I took my listbox value like this</p>
  
  <pre><code>cnt = LSTlocations.SelectedItems.Count
   Dim list As New List(Of Integer)
          Dim locid As Integer
          If cnt &gt; 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
   Dim da As New SqlDataAdapter
          Dim ds As New DataSet
          Dim cmd23 As New SqlCommand("T_TransactionSummary", con.connect)
          cmd23.CommandType = CommandType.StoredProcedure
          cmd23.Parameters.Add("@locations", SqlDbType.Int).Value = String.Join(",", list)
          da.SelectCommand = cmd23
          da.Fill(ds) 
  </code></pre>
  
  <p>if the code reach here i am getting error like this:</p>
  
  <pre><code>"Failed to convert parameter value from a String to a Int32  
  </code></pre>
  
  <p>i know am getting error in this line  </p>
  
  <pre><code>cmd23.Parameters.Add("@locations", SqlDbType.Int).Value = String.Join(",", list) 
  </code></pre>
  
  <p>but i want go the parameter to stored procedure like 1,2,3 only i am using vb.net. what i have to change in my code..any help is great appreciate ..</p>