c#添加问题?
MySqlDataAdapter = MyFunction.GetSqlDataAdapter("SELECT distinct college from college where college='" + comboBox1.Text.ToString().Trim() + "'");
MySqlDataAdapter.Fill(MyDataSet , "college");
if (MyDataSet.Tables["college"].Rows.Count > 0)
{
MessageBox.Show("同名学院已存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
我这个为什么只能添加一条再添加一条(不一样)也弹出同名学院已存在
明明学院aa
不存在我调试查了下
MyDataSet.Tables["college"].Rows.Count =1?
为什么啊 ?