private void Init_Form() { IMasterList objDonorList = (IMasterList)ObjectFactory.CreateInstance("BusinessProcess.SCM.BMasterList,BusinessProcess.SCM"); DataSet dsDonorList = objDonorList.GetDonorList(); MaxPId = Convert.ToInt32(dsDonorList.Tables[1].Rows[0][0]); ShowGrid(dsDonorList.Tables[0]); Clear_Form(); }