-
October 25th, 2012, 08:15 AM
#1
Duplicate values on dropdownlist
Hi,
I am having the follwing code;
Code:
Try
Dim PeerValue As New System.Data.SqlClient.SqlCommand(("Select PeerRvw From dbo.TblChangeControlDet WHERE ChangeID=@ChangeID"), conn)
PeerValue.Parameters.AddWithValue("@ChangeID", txtchangeID.Text)
Using Autoreader As System.Data.SqlClient.SqlDataReader = PeerValue.ExecuteReader()
While Autoreader.Read()
Dim PeerRvw As String = Autoreader.GetValue(0)
cmbpeername1.SelectedItem.Text = PeerRvw
End While
End Using
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information, "CCMS")
End Try
Works fine, however, when I click the dropdownlist the combobox (cmbperrname1) I have duplicate values for the selecteditem.
E.g.,
Combobox has 3 values
A
B
C
Results when you select the dropdownlist;
B - Selecteditem
A
B
C
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|