I am facing a problem . I have a Parent Form . Where i am creating 20 Datatable
that is using to bind the combobox for child form. So i want that i create a public function .I want to pass the datatable that is created on my Parent form i can use on child form as ref . So how can i do that . Present i am using this code but every time when child form every time its fire my parent page function. What i am doing wrong, What will be the best approach to do this.
I also take a reference form my previous Question and convert my dataset to LIST Type but the load time of form not decrease.
Parent Form
public DataTable _tableZip (ref DataTable zip)
{
if (_forderdac == null)
_forderdac = new foOrderDAC();
DataTable _tblZip = new DataTable();
_tblZip = _forderdac.GetZipPostal(appDirectory, this.FindForm().Name, "frmCometFastOrderEntry").Tables[0];
return _tblZip;
}
Child form
DataTable _tableZip = new DataTable();
cmblookupPickZip.DataSource = _frmcometfast._tableZip(ref _tableZip);
if (_tableZip.Rows.Count > 0)
{
cmblookupDropZip.DisplayMember = "ZIPPOSTAL";
cmblookupPickZip.ValueMember = "AREAID";
cmblookupPickZip.SelectedIndex = -1;
}
thanks for your comments .