Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Dim i As Integer = 1
        Dim statechck As String = "occupy"
        Dim state As String



i wish to change the image in the buttons using loop at form load

VB
While i <= 56
            Dim Str As String = "Select Status from Status where SeatNo = '" + i + "'"
            Dim reader As OleDbDataReader = cmd.ExecuteReader()

            While reader.Read()
                state = reader.GetValue(0).ToString()

                If state = statechck Then
                button[i].image= My.Resources.ResourceManager.GetObject("greenseat"))'gives error

                End If
                i = i + 1

            End While
Posted
Updated 18-Apr-13 23:31pm
v2
Comments
[no name] 19-Apr-13 7:35am    
'gives error'... don't you think that telling us what the error is that you are getting is kind of need-to-know information?

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900