Link to home
Start Free TrialLog in
Avatar of Cannibal_Jack
Cannibal_Jack

asked on

Adding data to from dataset to rows

Hi,
    I'm trying to link my sql database to my textbox autocomplete function, I think I almost have it...

       Dim da As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter("SELECT colours FROM ColourTable", conn)
        Dim ds As DataSet = New DataSet
        da.Fill(ds, "ColourTable")
        For Each dRow In myTable.Rows
            TextBox.AutoCompleteCustomSource.Add(drow("fieldname"))
        Next

I'm getting the following errors...
drow and mytable are not declared.
Could some one help me fix this, thanks.
Avatar of LordWabbit
LordWabbit

unfortunately you need to do an API call

http://www.codeguru.com/csharp/csharp/cs_misc/icons/article.php/c4261/

what might be an idea is to have a small db with file extensions and the relevant images, then just do a lookup and assign the image to the list item.  the drawback's for this is if you come across a file extension you didn't cater for you will have to use a generic icon, and if the icon changes (new version of word etc) then you will still be displaying the old one.
ASKER CERTIFIED SOLUTION
Avatar of LordWabbit
LordWabbit

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Cannibal_Jack

ASKER

Thank you, Spot on