首页 新闻 会员 周边

如何进行好友生日提醒

0
[已解决问题] 解决于 2015-06-02 18:29
    private void Bind(string txt)
        {
            string sql = string.Format("select*from Good");
            if (this.comboBox1.Text != string.Empty)
            {
                sql += string.Format(" where [Good-name]='{0}'",txt);
                sql += string.Format(" where [Good-age]='{0}'", txt);
                sql += string.Format(" where [Good-gender]='{0}'", txt);
                sql += string.Format(" where [Good-qq]='{0}'", txt);
                sql += string.Format(" where [Good- phone]='{0}'", txt);
                sql += string.Format(" where [Good-wechat]='{0}'", txt);
                sql += string.Format(" where [Good-date]='{0}'", txt);
            }
            DataTable dt = DBHelper.getTable(sql);
            this.dataGridView1.DataSource = dt;
            this.comboBox1.SelectedIndex = 0;
        }
        private void 设置好友基本信息ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form1 f1 = new Form1();
            f1.Show();
            this.Hide();
        }

        private void Form2_Load(object sender, EventArgs e)
        {
            Bind(string.Empty);
        }

        private void 查询_Click(object sender, EventArgs e)
        {
            string cob = this.comboBox1.Text.Trim();
            if (cob != string.Empty)
            {
                Bind(cob);
            }
        }   

如何通过代码,进行传值,来定时提醒好友到了所预定的生日区间时,会通过Timer控件来提醒
,求帮忙!谢谢!

做一个有用的人的主页 做一个有用的人 | 菜鸟二级 | 园豆:202
提问于:2015-06-01 23:36
< >
分享
最佳答案
0

sql拼错了吧?

奖励园豆:5
悠扬的牧笛 | 初学一级 |园豆:156 | 2015-06-02 10:44
其他回答(1)
0

干嘛不用参数格式化查询呀!参考链接:http://www.cnblogs.com/hippieZhou/p/4486171.html

hippieZhou | 园豆:578 (小虾三级) | 2015-06-02 11:20
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册