Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello everyone,

I need some help PLEASE!

I have an application in which I am accessing a MySql Database. I query the database and store the results in a datatable. I then have to pull select information from the results datatable and add them to a different datatable. Everything works fine except for when I try to add the first line to the new DataTable. The very first Row I Add takes 6-7 seconds, after that it takes no time. I won't have that problem again until I restart the application. Following is a snippet of code where the problem occurs:

 

 

		dsDoctorList.Clear();
		DataTable dtDocAppts = dsDoctorList.Tables["DoctorAppts"];
					
		DataTable dtDocs = docSql.PullDocs();
		
		//Load Doctor Number and Name
		foreach(DataRow dr in dtDocs.Rows)
		{
			DataRow myRow = dtDocAppts.NewRow();
			myRow["doctor"] = dr["doctor"];
			myRow["name"] = dr["name"];

//Right here is where it takes so long on the first add				
                              dtDocAppts.Rows.Add(myRow);
		}

 

Does anyone have any suggestions as to what is causing this.

Thanks,

 

Kendal

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...