private void button1_Click(object sender, EventArgs e) { StudentsAffairsSystemServer.Service1 StudentsAffairsSystem = new StudentsAffairsSystemServer.Service1(); List <StudentsAffairsSystemServer.InformationTeacher> obj1 = new List <StudentsAffairsSystemServer.InformationTeacher>(); obj1 = StudentsAffairsSystem.SpecificTeachersProfile().ToList(); foreach (StudentsAffairsSystemServer.InformationTeacher obj in obj1) { textBox1.Text = obj.UserName; textBox3.Text = obj.ContactNumber; textBox2.Text = obj.EmailId; textBox4.Text = obj.Department; } }