alexa-tracking

Main Content

1024
1024
KASKUS
51
244
https://www.kaskus.co.id/thread/52f889f720cb17e63e8b4780/askfailed-to-convert-parameter-value-from-a-list-1-to-a-ienumerable-1
[SOLVED]Failed to convert parameter value from a List '1 to a ienumerable '1
Teman-teman yth,
Ketika saya akan mengirim sebuah list ke parameter di sql server yang bertipe table, saya mendapatkan pesan ini:

Failed to convert parameter value from a List '1 to a ienumerable '1

Potongan kodingan saya:

da = New SqlDataAdapter
ds = New DataSet
Dim daftarikan As List(Of String)
daftarikan = New List(Of String)
If listikan.SelectedItems.Count <> 0 Then
Try
tk.txtno.Text = txtno.Text
tk.txtinforman.Text = txtnama.Text
tk.txtupt.Text = cmbnegara.SelectedItem.ToString()
tk.txtalamat.Text = txtalamat.Text

Dim x As Integer
For x = 0 To listikan.SelectedItems.Count - 1
daftarikan.Add(CStr(listikan.SelectedItems(x)))
Next x
cmd = New SqlCommand
cmd.Connection = koneksi.kone
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "select_laporan_akhir"
cmd.Parameters.Add("@nama_ikan", SqlDbType.Structured)
cmd.Parameters("@nama_ikan").TypeName = "tbelikan"
cmd.Parameters("@nama_ikan").Value = daftarikan
cmd.Parameters.Add("@upt", SqlDbType.VarChar, 255).Value = cmbnegara.SelectedItem.ToString()
da.SelectCommand = cmd
da.Fill(ds, "hasil")
tk.dginfo.DataSource = ds
tk.dginfo.DataMember = "hasil"
tk.Show()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End If
wah gan ane ga bisa bantu emoticon-Sorry
emoticon-Big Grin...