You must Sign In to post a response.
  • Category: ASP.NET

    Reading 3 text files and inserting into 3 SQL tables usingC#

    Hi Team,

    3 text files placed in some path,data read and validation should happen.

    Lastly inserting into 3 tables.

    Am getting for one table but not getting how to do for 3 tables in sequence manner.

    Please let me know the answer.
  • #767959
    Hi Shashi,

    Yes. You are expecting to run 3 job at a time parallel basis. Right now its not working because,
    When you call a function like

    string CallRunningMethod (string a,string b)
    Thread.Sleep (iCallTime) ;
    iExecThread = AppDomain.GetCurrentThreadId ();
    return "MyCallTime was " + iCallTime.ToString() ;

    So until this function completed or return a value it wont start the other functions. Because entire control will be their and once that is completed then it will move to the next condition.

    So overcome this situations Microsoft provided a concept called calling a method asynchronously.

    The Microsoft .NET Framework makes it easy to call functions asynchronously. Calling functions asynchronously causes the system to execute them in the background on a secondary thread while the calling function continues to do other work. In a typical (synchronous) function call, the function is executed right away on the same thread that made the call. The calling function waits for the call to complete and receives the results of the call before continuing. By contrast, when you make an asynchronous call, you retrieve the results of the asynchronous call later. This article demonstrates how to do this by using Visual C#.

    Kindly refer the below website for performing your requirement.


  • Sign In to post your comments