Using a Thread in a Web Application to Access a Database
Hi. Is it possible to use a thread to interact with a database?
I want to do some logging of user transactions but I don't want to hold up the user while he/she is interacting with the website.
I have found some examples tf using threads in a Windows application, but very little for web-applications.
I really could use an example where a thread starts aparameratized function, and how to set this up.
So far, as a test, I have tried:
Thread t =
new Thread(new ThreadStart(Send_Email_Edit_Value));t.Start(transaction, List_Name, IB_Acct, Current_Acct, Current_Value, strNewValue, Current_Unit, New_Unit);
The function I am trying to start is:
privatevoid Send_Email_Edit_Value(string transaction,string List_Name,string IB_Acct,string Current_Acct,string Current_Value,string strNewValue,string Current_Unit,string New_Unit)
{
this.transaction = transaction;
this.List_Name = List_Name;
this.IB_Acct = IB_Acct;
this.Current_Acct = Current_Acct;
this.Current_Value = Current_Value;
this.strNewValue = strNewValue;
this.Current_Unit = Current_Unit;
this.New_Unit = New_Unit;
string mailTo =address@mail.com;
//do stuff
}
But I get compilation errors:
Send_Email_Edit_Value(string, string, string, string, string, string, string, string)' does not match delegate 'void System.Threading.ThreadStart()'
AND
IB_Data.cs(633): No overload for method 'Start' takes '8' arguments
Any Ideas or sample code?
Thanks in advance,
Frank

