日期:2014-05-17 浏览次数:20898 次
private void Form1_Load(object sender, EventArgs e)
{
this.comboBox1.TextChanged -= new System.EventHandler(this.comboBox1_TextChanged);
DataSet dataSet = GetUriResultInfo();//即初始化查询
for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++)
{
this.comboBox1.Items.Add(dataSet.Tables[0].Rows[i]["Content"]);
}
this.comboBox1.TextChanged += new System.EventHandler(this.comboBox1_TextChanged);
}
private void comboBox1_TextChanged(object sender, EventArgs e)
{
try
{
this.comboBox1.TextChanged -= new System.EventHandler(this.comboBox1_TextChanged);
comboBox1.Items.Clear();
string text = this.comboBox1.Text;
DataSet dataSet = GetUriResultInfo(text);
//if (this.comboBox1.Text != "" && this.comboBox1.Text != " ")
//{
// comboBox1.DataSource = null;
//}
//comboBox1.DataSource = dataSet.Tables[0];
//comboBox1.DisplayMember = "Content";
//comboBox1.ValueMember = "SeqNo";
//comboBox1.SelectedIndex = -1;
for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++)
&nbs