本文介绍了如何创建生日提醒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在我的应用程序中创建生日提醒,生日提醒我希望在标签中以逗号分隔显示意味着假设在一天内生日那么它应该以欢乐,约翰格式显示我尝试编写此任务但它不是工作,希望你们在这里得到我的观点我粘贴我的代码请给我修改代码或新代码



i want create birthday reminder in my application,birthday reminder i want to show in label with comma separated means suppose tow birthday in one day then it should show in "joy,john" format iam try to code this task but it not working,hope you all getting my point here im paste my code please give me modified code or fresh code

public void birthday_reminder()


            con = new SqlConnection("Data Source=ADMIN\\SQLEXPRESS;Initial Catalog=PhysioCure; Integrated Security=true");
            con.Open();
                DateTime dtmain = System.DateTime.Now;
                 CultureInfo inculture=new CultureInfo ("hi-IN");
                 dtmain = DateTime.Parse("18/01/1989", inculture.DateTimeFormat);
            //cmd = new SqlCommand("select PationName,ContactNo from Physio_cureTable where DateOfBirth like '" + dtmain.Date.ToString().Substring(0, 5) + "%'", con);
            cmd = new SqlCommand("select PationName,ContactNo from Physio_cureTable where DateOfBirth like '" + dtmain.Date.ToShortDateString().Substring(0, 5) + "%'", con);
            SqlDataReader reader = cmd.ExecuteReader();
            while (reader.Read())
            {
                label18.Text = reader.GetInt32(0).ToString();
                label18.Text = reader.GetString(3).ToUpper();
                label19.Text = reader.GetString(5).ToUpper();

            }
            reader.Close();
            con.Close();
        }

推荐答案


这篇关于如何创建生日提醒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 22:26