I have created a Windows Form App for Managed Care(CRUD of Member Data). It is an internal app that uses Merge Replication to allow field use. The app basically follows this structure:
- Form Shell
- Form MemberHost
- Form Member
- Form MemberContacts
- Form MemberInsurance
- Form Enrollments
- Form CaseNotes
- Form MemberCenteredPlanHost
- Form MCPPlan
- Form MCPWorkers
- Form MCPDiagnosis
- Form MCPProviders
- Form MCPDomains
- Form MCPHealthReview
- Form MCPEmployment
- Form MemberHost
As you can see my app embeds(docks) multiple forms in Hosts using a tabControl and this piece of code -->
public static void ShowFormInContainerControl(Control ctl, Form frm)
{
frm.TopLevel = false;
frm.FormBorderStyle = FormBorderStyle.None;
frm.Dock = DockStyle.Fill;
frm.Show();
//frm.Visible = true;
ctl.Controls.Add(frm);
}
Now, when the App first Loads it loads ALL forms. Then after the user SELECTS a member it places a Call to FormModuleHost.FormPaint(int PersonID) which then runs down the list I illustrated above. This takes a long time (approx 10secs the first time). Long enough that the not responding pops up. I am trying to figure out how I can speed this process up.
Each *FormPaint()*(custom method not the event!) calls multiple SProcs but only to the LocalDB. The majority of the SProcs are returning a DATASET (I didn't write these). All info, almost, needs to be loaded up front, for a member, as the user is allowed to jump right to certain portions(as illustrated by the bullet list).
How can I go about speeding this process up? What area should I look at? I cannot modify the SPROCS(DAL) in any way though I can create an alternate one using whatever I want(LINQ??).
If I replaced all the Forms(18 embedded) with UserControls does anyone think I would see any performance gain?
Where else can I look?
I don't believe I can use threading as each FormPaint() is updating it's Form's UI though I don't know much about threading and could easily be wrong here.
I also am starting to get the idea that my problem might be that my cod. is not properly structured. I am filling my datasets in the same function as where i am loading the controls with the data.