如果用ListBox1.Items.Add(...) 来增加列表项的话 怎么分别设置它的text 和 value??
------解决方案--------------------------------------------------------
ListBox1.Items.Add(new ListItem())
------解决方案--------------------------------------------------------
ListBox1.Items.Add(new ListItem("Text", "Value"));
------解决方案--------------------------------------------------------
string sqlstr = string.Format( "SELECT DealerName, DealerCode FROM Dealer" );
DataTable dt = data.GetTable( sqlstr );
int n = dt.Rows.Count;
for( int i = 0; i < n; i++ )
{
ListItem lt = new ListItem( (string)dt.Rows[i][0], (string)dt.Rows[i][1] );
DealerList.Items.Add( lt );
}