Exemplo n.º 1
0
        private void Treatments_Load(object sender, EventArgs e)
        {
            string sql  = "select count(Treatment_ID)  from Treatment;";
            string sql1 = "select Patient_Name from Patient_Details";

            count = db.GetIntValue(sql);
            // set data from database to combo box
            comboxPname.DataSource    = db.SelectOneColumn(sql1).Tables[0];
            comboxPname.DisplayMember = "Patient_Name";

            comboxPname.Text    = "Select Patient";
            dateTreatment.Value = DateTime.Today;

            txttid.Text = (count + 1).ToString();
        }
Exemplo n.º 2
0
 public void data(ComboBox cmb, string sql, string displayMem, string text)
 {
     cmb.DataSource    = db.SelectOneColumn(sql).Tables[0];
     cmb.DisplayMember = displayMem;
     cmb.Text          = text;
 }