各位高手,请帮我看下这段代码哪里有问题啊(初学者的白痴问题)
private void button1_Click(object sender, EventArgs e) {
OdbcConnection conn = new OdbcConnection();
conn.ConnectionString = "Driver={Microsoft Visual FoxPro Driver};" + "SourceType=DBF;" + "SourceDB=ems;" + "Exclusive=No";
conn.Open();
string sqlm = "select owner from REGITABL where signno='" + this.textBox1.Text + "'";
DataSet dsm = new DataSet();
SqlDataAdapter adaptern = new SqlDataAdapter(sqlm, conn);
try
{
adaptern.Fill(dsm, "REGITABL");
for (int i = 0; i < dsm.Tables[0].Rows.Count; i++)
{
comboBox1.Items.Add(dsm.Tables[0].Rows[i]["owner"].ToString());
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
我自己觉得可能是SqlDataAdapter adaptern = new SqlDataAdapter(sqlm, conn);有问题 但有不知道怎么改 高手指点啊。