By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,182 Members | 1,126 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,182 IT Pros & Developers. It's quick & easy.

Please Help with the combox DisplayValue property

P: n/a
Please Help with the combox DisplayValue property

private void cboClient_SelectionChangeCommitted(object sender,
System.EventArgs e)
String strSQL;
strSQL = "SELECT F.FollowUpPerson FROM tblFollowUpPerson F INNER JOIN
tblFollowUpPersonClient C ON F.FollowUpPersonID = C.FollowUpPersonID WHERE
C.ClientKey = '" + this.cboClient.SelectedValue + "' ";
ds = mg.GetDataSet(strSQL,"userList"); //Def is described at the end

cmbUserList.DataSource = ds;
cmbUserList.DisplayMember = "FollowUpPerson";
cmbUserList.ValueMember = "FollowUpPerson";


public DataSet GetDataSet(string sqlQuery, string name)
SqlConnection conn = null;

if ( m_connInfo == null )
return null;

if ( persistTrans == null )
conn = new SqlConnection(m_connInfo.DBConnString);
conn = persistTrans.Connection;

m_dataAdapter = new SqlDataAdapter(sqlQuery, conn);
SqlCommandBuilder cmdBuilder = new SqlCommandBuilder(m_dataAdapter);
DataSet dataSet = new DataSet(name);
m_dataAdapter.SelectCommand.CommandTimeout = m_connInfo.CommandTimeout;

return dataSet;
catch(Exception e)
return null;
if ( persistTrans == null && conn != null )

My application get crashes in
cmbUserList.DisplayMember = "FollowUpPerson";

Could u pls telll me why?

THe error message is
"An unhandled exception of type 'System.ArgumentException' occurred in
Additional information: Could not bind to the new display member."



Jul 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.