Hi Guys,
This is my first post here at vbdotnetforums, so forgive me if this is in the wrong area or something. I'm just starting out using vb.net and i am writing my first application. I have added some comboboxes at runtime to my form using the code below.
Now my question is now that i have these controls added to the form, how can i iterate through them all and collect the values for sql injection. I have given each combobox a specific name when it was created such as Ball1, Ball2, Ball3.
I was hoping i could do something like this.
Thanks for the help.
This is my first post here at vbdotnetforums, so forgive me if this is in the wrong area or something. I'm just starting out using vb.net and i am writing my first application. I have added some comboboxes at runtime to my form using the code below.
VB.NET:
Private Sub AddCombobox(ByVal ControlName As String, ByVal Top As Integer, ByVal Left As Integer, ByVal IsSupp As Boolean, ByVal HighestNumber As Integer)
Dim BoxValues As Integer = LottoClass.LowestNumber
Dim NewCombo As New ComboBox
NewCombo.Name = ControlName
NewCombo.Width = ControlWidth
NewCombo.Height = ControlHeight
NewCombo.Top = Top
NewCombo.Left = Left
If IsSupp Then
NewCombo.BackColor = Color.FromKnownColor(KnownColor.MistyRose)
End If
Do Until BoxValues = HighestNumber + 1
NewCombo.Items.Add(BoxValues)
BoxValues += 1
Loop
Me.HistGroup.Controls.Add(NewCombo)
BoxValues = LottoClass.LowestNumber
End Sub
Now my question is now that i have these controls added to the form, how can i iterate through them all and collect the values for sql injection. I have given each combobox a specific name when it was created such as Ball1, Ball2, Ball3.
I was hoping i could do something like this.
VB.NET:
ControlName = "Ball" & ctype(i,String)
ControlValue = ControlName.Selectedindex
Thanks for the help.