Click here to Skip to main content
15,889,281 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
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

C#
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();
        }
Posted
Updated 31-Aug-17 0:16am
v2
Comments
Andreas Gieriet 10-Feb-13 13:49pm    
So, what is the question? Please improve your question.
Not clear what the problem is. Any error while compiling or while running?
Cheers
Andi
Atul Rokade 11-Feb-13 10:34am    
Andi There is no error while compiling or running, above my code is not given me what i want output like i want if suppose today is your birthday then it should show in .cs form in label "Happy Birthday to Adreas Gieriet" hope this time you are understand my problem

:)

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900