R
Ravindra
Hi all,
i want to retrieve the values from database and edit them. I have drop down
list for gender. item :male and female.here is the code.
con.Open()
cmd = New SqlCommand("select * from customers where fullname='" & fname &
"'", con)
Dim dr As SqlDataReader
dr = cmd.ExecuteReader
While dr.Read
Me.txtName.Text = dr.Item("Fullname")
Me.txtAddress.Text = dr.Item("address")
Me.txtAreaCode.Text = dr.Item("areacode")
Me.txtTelePhone.Text = dr.Item("telephone")
Me.txtComments.Text = dr.Item("comments")
Me.txtEmail.Text = dr.Item("email")
Me.txtVisits.Text = dr.Item("novisits")
Me.ddlPrice.SelectedItem.Value = dr.Item("price")
Me.ddlGender.SelectedItem.Text = dr.Item("gender")
Me.ddlAntiVirus.SelectedItem.Text = dr.Item("antivirus")
Me.txtCity.Text = dr.Item("city")
Me.ddlstatus.SelectedItem.Text = dr.Item("status")
End While
con.Close()
but i am getting the error, i.e in gender drop down i could see female
,female. There is no male in list.So plz clarify this
regards
ravindra
i want to retrieve the values from database and edit them. I have drop down
list for gender. item :male and female.here is the code.
con.Open()
cmd = New SqlCommand("select * from customers where fullname='" & fname &
"'", con)
Dim dr As SqlDataReader
dr = cmd.ExecuteReader
While dr.Read
Me.txtName.Text = dr.Item("Fullname")
Me.txtAddress.Text = dr.Item("address")
Me.txtAreaCode.Text = dr.Item("areacode")
Me.txtTelePhone.Text = dr.Item("telephone")
Me.txtComments.Text = dr.Item("comments")
Me.txtEmail.Text = dr.Item("email")
Me.txtVisits.Text = dr.Item("novisits")
Me.ddlPrice.SelectedItem.Value = dr.Item("price")
Me.ddlGender.SelectedItem.Text = dr.Item("gender")
Me.ddlAntiVirus.SelectedItem.Text = dr.Item("antivirus")
Me.txtCity.Text = dr.Item("city")
Me.ddlstatus.SelectedItem.Text = dr.Item("status")
End While
con.Close()
but i am getting the error, i.e in gender drop down i could see female
,female. There is no male in list.So plz clarify this
regards
ravindra