Dim conn As New SqlConnection(constr)
conn.Open()
Dim sql As String = "SELECT * FROM testd"
Dim cmd As New SqlCommand(sql, conn)
Dim ada As New SqlDataAdapter(cmd)
Dim data As New DataSet
ada.Fill(data, "0")
Dim rs As SqlDataReader = cmd.ExecuteReader()
If rs.Read Then
For i = 0 To data.Tables("0").Rows.Count - 1
If Label1.Text = rs("room") Then
DropDownList1.SelectedIndex = rs("stat")
Label1.Text = rs("Price")
TextBox1.Text = rs("W")
ElseIf Label2.Text = rs("room") Then
DropDownList2.SelectedIndex = rs("stat")
Label2.Text = rs("Price")
TextBox2.Text = rs("W")
ElseIf Label3.Text = rs("room") Then
DropDownList3.SelectedIndex = rs("stat")
Label3.Text = rs("Price")
TextBox3.Text = rs("W")
ElseIf Label4.Text = rs("room") Then
DropDownList4.SelectedIndex = rs("stat")
Label4.Text = rs("Price")
TextBox4.Text = rs("W")
End If
Next
End If