Hey guys,

Having a bit of a problem. I have loaded a list of values from a mysql database into a CheckedListBox and want to be able to select them to eb used in a query. The CheckedListBox shows the data as table_name.attribute_name, and when an item is selected I try to break up the two values by using a substring, like this:

Dim strTable As String = clbFields.GetItemText(clbFields.SelectedItem.Substring(0, clbFields.SelectedItem.IndexOf("."))).ToString
        Dim strAttribute As String = clbFields.GetItemText(clbFields.SelectedItem).ToString

Whenever I select an item though it comes up with the error "Public member 'IndexOf' on type 'DataRowView' not found."
What needs to be changed?

Thanks in advance :)

Post ur complete code... are u trying in datarow view? Cant you get the value to string variable and do indexof(.)?

Ok, yeah, I was being a bit slow there, sorry lol.

I had a variable that was getting the whole thing and had it as a string after where I was trying to break it up, so I've put that so it's being set before and just used it from that variable.

Thanks for your reply :)

This question has already been answered. Start a new discussion instead.