Author: florble | Posted on: 2/12/2010 5:24:19 AM | Views : 325

Hi,

New to vb so please go easy on me

Im trying to populate the combobox with items that are returned from a search of the database with linq from the combobox when the text changes(in the combo box)

here is some of my code:

Dim db As New ProdLinqDataContext

Dim searchstring = ComboBox1.Text
If searchstring.Length > 2 Then
Dim prods = From p In db.Products _
Where p.SKU.Contains(ComboBox1.Text) _
Select p _
Take 25

ComboBox1.AutoCompleteSource = prods

'ComboBox1.Items.Add(prods)
Else
'Not sufficiently filtered. Keep the suggestion list blank.
'searchstring.AutoCompleteSource = New String() {}
End If
End Sub

I have tried loads of ways to do this and i get the same error:

System.I ...

Go to the complete details ...