Click here to Skip to main content
15,909,373 members
Home / Discussions / C#
   

C#

 
GeneralRe: Executable containing executable Pin
espeholt_jr15-Apr-07 21:04
espeholt_jr15-Apr-07 21:04 
GeneralRe: Executable containing executable Pin
apostleofzion116-Apr-07 17:45
apostleofzion116-Apr-07 17:45 
QuestionRichtext Box undo problem Pin
7115-Apr-07 18:59
7115-Apr-07 18:59 
AnswerRe: Richtext Box undo problem Pin
Stefan Troschuetz15-Apr-07 21:06
Stefan Troschuetz15-Apr-07 21:06 
Questionthreads and acknowledgment Pin
joshkim8115-Apr-07 18:33
joshkim8115-Apr-07 18:33 
AnswerRe: threads and acknowledgment Pin
Luc Pattyn15-Apr-07 22:10
sitebuilderLuc Pattyn15-Apr-07 22:10 
AnswerRe: threads and acknowledgment Pin
pbraun16-Apr-07 5:16
pbraun16-Apr-07 5:16 
QuestionWorkerEventHandler.BeginInvoke() questions. Pin
Are Jay15-Apr-07 18:26
Are Jay15-Apr-07 18:26 
I have an application that is reading thousands of rows form an access database running calculations then updating the data. I'm using an Async. Design pattern that I'd found on MSDN and am getting my butt handed to me.
public void StartRecalculation() {<br />
try {<br />
FillArrayList();<br />
for ( int num = 0; num < m_Manifest.Count; num++ ) {<br />
// Task IDs are Guids.<br />
Guid taskId = Guid.NewGuid();<br />
<br />
// Start the asynchronous task.<br />
this.CalculateStartAsync( Int32.Parse( m_Manifest[ num ].ToString() ), taskId );<br />
} // end of for loop.<br />
} // end of try<br />
catch ( Exception ex ) {<br />
AddToErrorReport( ex.ToString() );<br />
}// end of catch<br />
} // end of StartRecalculation<br />
<br />
public void CalculateStartAsync( int _ticket, object taskId ) {<br />
// Create an AsyncOperation for taskId.<br />
AsyncOperation asyncOp = AsyncOperationManager.CreateOperation( taskId );<br />
<br />
// Multiple threads will access the task dictionary,<br />
// so it must be locked to serialize access.<br />
lock ( userStateToLifetime.SyncRoot ) {<br />
if ( userStateToLifetime.Contains( taskId ) ) {<br />
throw new ArgumentException( "Task ID parameter must be unique", "taskId" );		<br />
} // end of userStateToLifetime.Contains( taskId )<br />
<br />
userStateToLifetime[ taskId ] = asyncOp;<br />
} // end of lock this<br />
<br />
// Start the asynchronous operation.<br />
WorkerEventHandler workerDelegate = new WorkerEventHandler( CalculateWorker );<br />
workerDelegate.BeginInvoke( _ticket, asyncOp, null, null );<br />
} //end of CalculateStartAsync<br />


My question is when creating the WorkerEventHandler ie..
WorkerEventHandler workerDelegate = new WorkerEventHandler( CalculateWorker );

And then calling the BeginInvoke
workerDelegate.BeginInvoke( _ticket, asyncOp, null, null );

Is this creating a new instance of the CalculateWorker Method and other referenced methods?
Will I need to isolate my tableAdapters to each method and create new each time or will I be able to us a global Dataset to store and manipulate the inforamtion.

I'm having trouble completing anything within my database. I'm getting random rows not found and outOfIndex exceptions. If anyone has any advice on the topic, please help.

thanks.

I'm listening but I only speak GEEK.

AnswerRe: WorkerEventHandler.BeginInvoke() questions. Pin
Luc Pattyn16-Apr-07 4:06
sitebuilderLuc Pattyn16-Apr-07 4:06 
GeneralRe: WorkerEventHandler.BeginInvoke() questions. Pin
Are Jay16-Apr-07 4:54
Are Jay16-Apr-07 4:54 
GeneralRe: WorkerEventHandler.BeginInvoke() questions. Pin
Luc Pattyn16-Apr-07 6:49
sitebuilderLuc Pattyn16-Apr-07 6:49 
GeneralRe: WorkerEventHandler.BeginInvoke() questions. Pin
Are Jay20-Apr-07 13:40
Are Jay20-Apr-07 13:40 
QuestionObject Reference not Set an instance of an object while Querying the 2003 Active Directory Pin
Zach198315-Apr-07 17:28
Zach198315-Apr-07 17:28 
AnswerRe: Object Reference not Set an instance of an object while Querying the 2003 Active Directory Pin
Luc Pattyn16-Apr-07 4:10
sitebuilderLuc Pattyn16-Apr-07 4:10 
GeneralRe: Object Reference not Set an instance of an object while Querying the 2003 Active Directory Pin
Zach198316-Apr-07 8:27
Zach198316-Apr-07 8:27 
GeneralRe: Object Reference not Set an instance of an object while Querying the 2003 Active Directory Pin
Luc Pattyn16-Apr-07 8:58
sitebuilderLuc Pattyn16-Apr-07 8:58 
QuestionRe: Object Reference not Set an instance of an object while Querying the 2003 Active Directory Pin
Zach198318-Apr-07 10:13
Zach198318-Apr-07 10:13 
QuestionRe: Object Reference not Set an instance of an object while Querying the 2003 Active Directory Pin
Zach198318-Apr-07 10:22
Zach198318-Apr-07 10:22 
AnswerRe: Object Reference not Set an instance of an object while Querying the 2003 Active Directory Pin
Luc Pattyn18-Apr-07 14:04
sitebuilderLuc Pattyn18-Apr-07 14:04 
QuestionHelp selecting xml nodes Pin
drifters15-Apr-07 17:02
drifters15-Apr-07 17:02 
AnswerRe: Help selecting xml nodes Pin
Christian Graus15-Apr-07 17:36
protectorChristian Graus15-Apr-07 17:36 
GeneralRe: Help selecting xml nodes Pin
drifters15-Apr-07 17:42
drifters15-Apr-07 17:42 
QuestionWindow Focus Pin
dirkwilliams15-Apr-07 16:03
dirkwilliams15-Apr-07 16:03 
AnswerRe: Window Focus Pin
Luc Pattyn15-Apr-07 23:16
sitebuilderLuc Pattyn15-Apr-07 23:16 
QuestionQuestion about detecting mouse click using? Pin
Khoramdin15-Apr-07 15:31
Khoramdin15-Apr-07 15:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.