G
Goos van Beek
Hello.
I'm using the following code to fill a combobox on a Windows form:
private void FillCboRelation(){
using(SqlCommand sqlStatement = new SqlCommand("sp_RelationList",cnn)) {
using(SqlDataReader rdReader=sqlStatement.ExecuteReader()){
while(rdReader.Read()){
cboRelation.Items.Add(rdReader["FullName1"].ToString());
}//end while
}//end using rdReader
}//end using sqlStatement
}
When using a combobox on a webform I can use for instance
cboRelation.Items[cboRelation.Items.Count-1].Value=rdReader["RelationId"].To
String();
to add some data to the value property of the dropdownlist.
Is there a way to do something similar on the combobox?
Goos.
I'm using the following code to fill a combobox on a Windows form:
private void FillCboRelation(){
using(SqlCommand sqlStatement = new SqlCommand("sp_RelationList",cnn)) {
using(SqlDataReader rdReader=sqlStatement.ExecuteReader()){
while(rdReader.Read()){
cboRelation.Items.Add(rdReader["FullName1"].ToString());
}//end while
}//end using rdReader
}//end using sqlStatement
}
When using a combobox on a webform I can use for instance
cboRelation.Items[cboRelation.Items.Count-1].Value=rdReader["RelationId"].To
String();
to add some data to the value property of the dropdownlist.
Is there a way to do something similar on the combobox?
Goos.