473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Asynchronous data access in ASP.NET

Hi All,

I am lil confused with different ways of asynchronous data access.

My understanding is that, asynchronous data access frees up a thread
instead of engaging it while a stored proc is being executed. This
makes more threads available. Is this correct or are there ay other
advantages of asynchronous data access?

My questions are:

1. I cannot set the async page directive to true as suggested in
some articles. I get an error saying incorrect page directive.

2. I can set async attribute in connection string as suggested in
few articles. I get error 'Keyword not supported.
Am I missing something to get the above errors or the articles I got
the above information from are outdated?

Here is my code. I made sense from 100 different sources before coding.
Would some one tell me if I am doing it correctly? I correctly see
deferent thread id's before and after data access.

Private Function getdata() As System.Data.SqlClient.SqlDataReader
Dim dr As System.Data.SqlClient.SqlDataReader

'code to run any sql get dr
If dr Is Nothing OrElse dr.IsClosed OrElse Not dr.HasRows Then
Return Nothing
Exit Function
End If
Return dr
End Function
Public Delegate Function AsyncDelegate() As
System.Data.SqlClient.SqlDataReader
Private Function getdataAsync() As
System.Data.SqlClient.SqlDataReader
Dim dlgt As New AsyncDelegate(AddressOf getdata)
Dim ar As IAsyncResult = dlgt.BeginInvoke(Nothing, Nothing)
'display(AppDomain.GetCurrentThreadId()) (this a thread)
Thread.Sleep(0)
Dim adr As System.Data.SqlClient.SqlDataReader =
dlgt.EndInvoke(ar)
'display(AppDomain.GetCurrentThreadId()) (this is a different
thread than the above.)
Return adr
End Function

I greatly appreciate any help.

Aug 23 '06 #1
0 994

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Michael Lindsey | last post by:
I need to write a server app to send images to client GUIs that are outside of the server's domain. The client will have the file system path to the image but can not access the file system. I am...
1
by: Natalia DeBow | last post by:
Hi, I am working on a Windows-based client-server application. I am involved in the development of the remote client modules. I am using asynchronous delegates to obtain information from...
0
by: Prodip Saha | last post by:
http://www.aspnet4you.com/Articles.aspx?ArticleID=5017 Asynchronous Data Access in ASP.NET (Live demo) Author: Saha,Prodip Posted:5/15/2005 6:03:17 PM Web Architecture is becoming...
7
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason...
1
by: dba123 | last post by:
I need to perform Asynchronous Inserts using DAAB. So far I have a method which does an insert but how can I do this Asyncronously so that it does not affect the load on our public production...
8
by: Simon Gorski | last post by:
I have a large problem, and I believe there is not yet a way to solve this using IIS and ASP.NET. I hope someone has a solution which we couldn't find. The current situation When a user logs...
0
by: vpidatala | last post by:
Hi All, I am lil confused with different ways of asynchronous data access. My understanding is that, asynchronous data access frees up a thread instead of engaging it while a stored proc is...
0
by: Bishoy George | last post by:
Hi, I have a asp.net 2.0 web application. I want to implement the asynchronous model through http handler in web.config ...
10
by: =?Utf-8?B?UiBSZXllcw==?= | last post by:
Hi, Problem: How can I databind (or put) a SqlServer query's row return of 115,000 items into a ComboBox quickly? Not much longer than a matter of seconds, that is... Scenario: I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.