Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim conn As New OleDb.OleDbConnection
Dim cmd As New OleDb.OleDbCommand
Dim i As Integer
conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\daan\Desktop\GP_FILMCLUB_ZULTE\GP_FILMCLUB_ZULTE\App_Data\GP_DATABASE_FILMCLUB.accdb"
cmd.Connection = conn
For i = 1 To 150
If cmd.CommandText = "Select Stoelnr = " & i & " FROM Zitjes Where Stoeltjes 1" Then
Button(i).BackColor = Drawing.Color.Red
Else
Button1(i).BackColor = Drawing.Color.Green
End If
Next
End Sub
End Class
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Seat reservation program
Jan 25, 2013 12:49 AM|LINK
Hi again,
Can you show us your code-behind?
I mean cs file's codes?
Any logic errors?
bbcompent1
All-Star
33097 Points
8529 Posts
Moderator
Re: Seat reservation program
Jan 25, 2013 11:19 AM|LINK
That is what I have been asking him for but the OP has yet to post it. Still waiting patiently.
bbcompent1
All-Star
33097 Points
8529 Posts
Moderator
Re: Seat reservation program
Jan 25, 2013 04:37 PM|LINK
j0zef, we want to help you but you have to help us by posting your code behind page. We don't know what your page is doing based on the HTML alone.
j0zef
None
0 Points
55 Posts
Re: Seat reservation program
Jan 26, 2013 10:44 AM|LINK
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load Dim conn As New OleDb.OleDbConnection Dim cmd As New OleDb.OleDbCommand Dim i As Integer conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\daan\Desktop\GP_FILMCLUB_ZULTE\GP_FILMCLUB_ZULTE\App_Data\GP_DATABASE_FILMCLUB.accdb" cmd.Connection = conn For i = 1 To 150 If cmd.CommandText = "Select Stoelnr = " & i & " FROM Zitjes Where Stoeltjes 1" Then Button(i).BackColor = Drawing.Color.Red Else Button1(i).BackColor = Drawing.Color.Green End If Next End Sub End Classthis is my code.
I have a error by button(i).backcolor
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Seat reservation program
Jan 26, 2013 11:32 AM|LINK
Hi j0zef,
Button in asp.net really has the property of BackColor,and Is your Button of a List?
j0zef
None
0 Points
55 Posts
Re: Seat reservation program
Jan 26, 2013 12:10 PM|LINK
I have create 150 buttons with the name button1,button2,button3
I have selected in the toolbox 150 buttons
hans_v
All-Star
35986 Points
6550 Posts
Re: Seat reservation program
Jan 26, 2013 08:47 PM|LINK
j0zef,
Perhaps you better send me a Private Message (in dutch? )
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Seat reservation program
Jan 26, 2013 11:38 PM|LINK
But that's not a list or a collection of Button……
If you insist doing so,you have to create a List<Button>,and then use your codes.
j0zef
None
0 Points
55 Posts
Re: Seat reservation program
Jan 27, 2013 07:55 AM|LINK
and how can I create a list of buttons?
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Seat reservation program
Jan 27, 2013 08:10 AM|LINK
Hi again,
Just create a List(Of Button), and then dynamically add Button to the List instance and show the Button onto webpage.