|
-
March 21st, 2011, 04:59 AM
#1
Parallel Processing in ASP.net Framework 2.0
Hi All,
I need to do parallel processing in my coding because i have 4 sql to fetch data from database which each take me 3-4 minutes.All the tables involved are raw table and that is no way i can reduce the time for the sql.
I need to find a way out to reduce the data fetching time.The only thing i canfigure out is to have this 4 sql execute at the same time by doing parallel processing.
Hi all, do you have any idea on fasterning the process other than parallel processing?
I have find online but no sample coding for parallel processing on .net framewrok 2.0.
Could anyone please share ith me?
-
March 28th, 2011, 07:54 AM
#2
Re: Parallel Processing in ASP.net Framework 2.0
Try to order your 4 SQL statements by how long they run , Longest one first to shortest one last.On the First 3 SQL connection strings add ";Asynchronous Processing=true"
and call thenhem all one after the other to run Async.
Code:
Dim Callback1 As IAsyncResult
Dim Callback2 As IAsyncResult
Dim Callback3 As IAsyncResult
.........
sqlconn1.ConnectionString = ConnectSql1 & ";Asynchronous Processing=true"
sqlconn2.ConnectionString = ConnectSql2 & ";Asynchronous Processing=true"
sqlconn3.ConnectionString = ConnectSql3 & ";Asynchronous Processing=true"
sqlconn4.ConnectionString = ConnectSql4
.........
Callback1 = sqlcmd1.BeginExecuteReader()
Callback2 = sqlcmd2.BeginExecuteReader()
Callback3 = sqlcmd3.BeginExecuteReader()
SqlDr4 = sqlcmd4.ExecuteReader()
SqlDr3 = sqlcmd3.EndExecuteReader(Callback3)
SqlDr2 = sqlcmd2.EndExecuteReader(Callback2)
SqlDr1 = sqlcmd1.EndExecuteReader(Callback1)
.........
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|