Example #1
0
        private void LoadAddStudentControl(object sender, EventArgs e)
        {
            ////ADD CODE HERE WHICH MAKES SURE STUDFENTTYPE AND PHONETYPE IS ADDED DYNAMICALLY

            /*
             * This function contains all code that needs to be executed when the control is first loaded
             *
             * You need to edit this code.
             * Example: Population of Comboboxes and gridviews etc.
             *
             */

            DataTable phoneTypeDt = dbconn.GetPhoneTypes();

            if (phoneTypeDt != null)
            {
                PhoneType.DataSource    = phoneTypeDt;
                PhoneType.DisplayMember = "PhoneTypeName";
                //PhoneType.ValueMember = phoneTypeDt;
            }
            else
            {
                PhoneType.Text = "No data found";
            }
            DataTable studentTypeDt = dbconn.GetStudentTypes();

            if (studentTypeDt != null)
            {
                StudentType.DataSource    = studentTypeDt;
                StudentType.DisplayMember = "StudentType";
            }
            else
            {
                StudentType.Text = "No data found";
            }
        }