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(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)