private void btnAdd_Click(object sender, EventArgs e) { Timetablesc tdc = new Timetablesc(); tdc.Date = dateTimePicker1.Text; tdc.Time = cmbTime.Text; tdc.Batch = cmbBatch.Text; tdc.Modcode = cmbModecode.Text; tdc.Lecname = cmbLecname.Text; tdc.Lechall = cmbLechall.Text; tdc.Lab = cmbLab.Text; Service2Client service = new Service2Client(); if (service.AddTimetables(tdc) == 1) { MessageBox.Show("Successfully Saved"); TableLoad(); } else { MessageBox.Show("Error.. Please Try Again"); } }