本帖最后由 skevil 于 2013-08-10 14:10:09 编辑

解决方案 »

  1.   

    拿新到的数据做这几个列的AND条件查询,找不到就可以插入了。
    select * from tablename where pathyear = 2012 and pathmonth = 12 and pathday = 12 and pathhour = 12
      

  2.   


    非常感谢!顺便再问你个问题啊
                        if (comboYear.Text != null)
                        {
                            string FindMonth = "select PathMonth from hzPath where 检查编号='" + txtID.Text + "'";
                            object readMonth = MySqlHelper.ExecuteScalar(MySqlHelper.Conn, CommandType.Text, FindMonth, null);
                            comboMonth.Items.Add(readMonth);
                        }
    我想将数据库内的值赋给comboYear ,但是现在好像只能赋给找到的第一项值,而要是之后还有其他值就不会出现在下拉菜单中,这要怎么实现呢?