public void add() { //checkAsignJobandAdd(); SowingJob s1 = new SowingJob(); s1.Description = tbDescription.Text; string idStr = cbCrop.Text.Split('.')[0]; s1.Crop_id = int.Parse(idStr); s1.Quantity_prop = Int32.Parse(nUDQty.Text); string idStr1 = cbFarm.Text.Split('.')[0]; s1.Farm_id = int.Parse(idStr1); s1.Used_area = textBox1.Text; string idStr2 = cbVehicle.Text.Split('.')[0]; s1.Vehicle_id = int.Parse(idStr2); string idStr3 = cbEmployee.Text.Split('.')[0]; s1.Employee_id = int.Parse(idStr3); s1.Date_start = this.dtpDate.Value; s1.Date_end = this.dtpDateEnd.Value; //s1.Employee_id = Int32.Parse(cbEmployee.Text); InsertSQL add = new InsertSQL(); int addrecord = add.addNewSowingJob(s1); MessageBox.Show("Success!!"); this.Close(); }