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

问题描述

你好朋友,



我正在创建一个有一个任务的应用程序,即显示多个患者生日提醒。

那个意味着提醒应该在该特定日期显示多个患者姓名。

患者姓名应该在一个标签中显示为逗号分隔,假设17/01/2013是两个患者的生日,那么它应该显示为生日快乐toJohn,Ricky。​​

我希望你能说明我实际上想说的是我在表单加载时编写了这段代码,但是它没有用。

Hello friends,

I am creating an application which has one task and that is to show multiple patient birthday reminders.
That means reminders should show multiple patient names on that particular date.
Patient name should show like comma separated in one label, suppose 17/01/2013 is the birthday off two patient then it should show like Happy Birthday to "John, Ricky".
I hope you are getting my point what I am actually trying to say I wrote this code in form load, but it not working.

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

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

推荐答案


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

09-17 19:32