Need to define variable count i=count
Becose I need to auto create number of buttons from counter
- SqlCommand cmd = new SqlCommand();
- cmd.CommandText = "SELECT COUNT(*) FROM roba_usluge";
- Int32 count = (Int32)cmd.ExecuteScalar();
-
- int top = 50;
- int left = 50;
- for (int i = 0; i = count.ToString(); i++)
- {
- Button button = new Button();
- button.Left = left;
- button.Top = top;
- button.Text = (i + 1).ToString();
- this.Controls.Add(button);
- top += button.Height + 2;
- }