.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Steve Jackman
Imran Ghani
Santhakumar Munuswamy

Home >> Forum >> Windows Application >> Post New QuestionBookmark and Share Subscribe to Forum

Threading in Windows application

Posted By: kamlesh     Posted Date: February 28, 2011    Points:2   Category :Windows Application
Hi..

I have created one application in which i want to use Threading.
Means i have created one button on that click event of button one form will open and i am importing big size data that data will store in database but up till the data will store that window will shown on screen i don't want to show that window (Submit button Click) up till the data will store so wt to do?

Responses
Author: Sunil Yadav       [Moderator]      
Posted Date: February 28, 2011     Points: 20   

Hi,

What kind of application you are working on?
Is it Windows or web based app?


If it is windows application,you can close the opened window and perform the importing operation on closing event.

private void Form2_FormClosing(object sender, FormClosingEventArgs e)
{
// Perform a importing here
}


Also,since you are importing bulk data, you can create a windows service to achieve this.

Let me know if you need any help.

Author: kamlesh             
Posted Date: March 06, 2011     Points: 20   

namespace WinExplorerBarGroupBoxAtRuntime.Export
{
public class ClsExportCreateXML
{
public void CreateXML(clsExport ExportDetail)
{

FileStream fs = new FileStream(AppDomain.CurrentDomain.BaseDirectory + "\\ExportMail.xml", FileMode.Create);
XmlWriter w = XmlWriter.Create(fs);
w.WriteStartDocument();
w.WriteStartElement("Restore");

w.WriteStartElement("UserCount", ExportDetail.UserList.Count.ToString());
w.WriteEndElement();
for (int UserCount = 0; UserCount < ExportDetail.UserList.Count; UserCount++)
{
w.WriteStartElement("UserMetaData");
w.WriteElementString("Name", ExportDetail.UserList[UserCount].UserName);
w.WriteElementString("Type", ExportDetail.UserList[UserCount].ExportType.ToString());
w.WriteElementString("FolderCount", ExportDetail.UserList[UserCount].FolderList.Count.ToString());

for (int FolderCount = 0; FolderCount < ExportDetail.UserList[UserCount].FolderList.Count; FolderCount++)
{
w.WriteStartElement("Folder");
w.WriteElementString("Name", ExportDetail.UserList[UserCount].FolderList[FolderCount].FolderName);
w.WriteElementString("Type", ExportDetail.UserList[UserCount].FolderList[FolderCount].ExportType.ToString());
w.WriteElementString("MailCount", ExportDetail.UserList[UserCount].FolderList[FolderCount].MailList.Count.ToString());
w.WriteStartElement("Mail");
for (int MailCount = 0; MailCount < ExportDetail.UserList[UserCount].FolderList[FolderCount].MailList.Count; MailCount++)
{
w.WriteElementString("Subject", ExportDetail.UserList[UserCount].FolderList[FolderCount].MailList[MailCount].Subject);
w.WriteElementString("Date", ExportDetail.UserList[UserCount].FolderList[FolderCount].MailList[MailCount].SentDate.ToString("yyyy-MM-dd HH:mm:ss"));
}
w.WriteEndElement();
w.WriteEndElement();
}


w.WriteEndElement();
}


w.WriteEndElement();
w.WriteEndDocument();
w.Flush();
fs.Close();

}



Thanks And Regards.
Kamlesh Nikam
Author: Maverick             
Posted Date: March 07, 2011     Points: 20   

Hello,

This link will be very useful for multithreading.

http://www.codeproject.com/KB/vb/mutithreading_for_beginer.aspx

Thanks,
Maverick

Thanks,
Maverick


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend