Hi All Masters
I'm trying to create a form with multiple labels from mysql database, im confused to add newlabel text from records
here's my code
Dim str As String
str = " Select koderoom from room "
da = New MySqlDataAdapter(str, conn)
ds = New DataSet
da.Fill(ds, "room")
For i = 1 To ds.Tables("room").Rows.Count
Dim newLabel As New Label
newLabel.Name = "Label" & i
**newLabel.Text = newLabel.Name**
newLabel.BorderStyle = BorderStyle.FixedSingle
newLabel.Size = New Drawing.Size(100, 100)
If (i = 1) Then
newLabel.Location = New Point(20, 20)
Else
newLabel.Location = New Point(20 * i + ((i - 1) * newLabel.Width), 20)
End If
Me.Controls.Add(newLabel)
Next
When I run the above code, the label text is show " label1, label2.....
I want to dislay label text from database records
What am I missing? Any suggestions as to how to fix this?
In Advance , Thanks for the help
Imam
Ps: I'm Using Visual Studio 2010 Express
In advance, thanks for any help.