473,378 Members | 1,377 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,378 software developers and data experts.

Beginexecutereader, endexecutereder, executereader

HI all,

Whats the differe between useing Executereader() and
Beginexecutereader()...endexecutereader() for asyncronys running of a SP

Thanks
Robert
Jul 4 '06 #1
5 6524
Robert Bravery wrote:
HI all,

Whats the differe between useing Executereader() and
Beginexecutereader()...endexecutereader() for asyncronys running of a SP

Thanks
Robert
The BeginExecuteReader(...) and EndExecuteReader...() are for performing the
ExecuteReader(...) method asynchronously. If you use ExecuteReader(...)
your thread is blocked while that method executes.

Using BeginExecuteReader(...) (and the corresponding EndExecuteReader(...))
ExecuteReader(...) will be executed in a seperate thread, allowing for
yours to continue processing. The BeginExecuteReader(...) method will
require a callback method, and in that callback method, you will make a
call to EndExecuteReader(...) to end the asynchronous operation, and
retreive the return value.

--
Hope this helps,
Tom Spink
Jul 4 '06 #2
Robert,
ExecuteReader is the synchronous version, whereas BeginExecuteReader and
EndExecuteReader are the asynchronous counterparts. EndExecuteReader would be
called in the callback method that BeginExecuteReader points to, to get your
resultset.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Robert Bravery" wrote:
HI all,

Whats the differe between useing Executereader() and
Beginexecutereader()...endexecutereader() for asyncronys running of a SP

Thanks
Robert
Jul 4 '06 #3
"Robert Bravery" <me@u.comwrote:
Whats the differe between useing Executereader() and
Beginexecutereader()...endexecutereader() for asyncronys running of a SP
Just to add to what the other folks say: you don't necessarily have to
use a callback with BeginExecuteReader(). You might be using it to get
simple concurrency, to mask latency:

IAR result = Begin...
// do other work
// now ready to pick up where we left off
reader = End...(result)

-- Barry

--
http://barrkel.blogspot.com/
Jul 4 '06 #4
HI,

Thanks for all the answers, I think I got most of that.
I started a beginexecutereader, which makes a call to a SP, which does a
selec tinto, of about 40000 rows.
I notice that the rows are only "saved" once the endexecutrereader is called
and completed.
i can however moce the calling form around and do other things
Is this expected behavious.
I was hoping to show some progress of some kind to the user while the SP is
doing its insert.

Thanks

Robert

"Barry Kelly" <ba***********@gmail.comwrote in message
news:vn********************************@4ax.com...
"Robert Bravery" <me@u.comwrote:
Whats the differe between useing Executereader() and
Beginexecutereader()...endexecutereader() for asyncronys running of a SP

Just to add to what the other folks say: you don't necessarily have to
use a callback with BeginExecuteReader(). You might be using it to get
simple concurrency, to mask latency:

IAR result = Begin...
// do other work
// now ready to pick up where we left off
reader = End...(result)

-- Barry

--
http://barrkel.blogspot.com/

Jul 4 '06 #5
Progress? Easy way, show an animated gif in a picturebox while wating. You
would have to have some intermediate events that you could respond to in
order to be able to show partial progress points, and I don't think there are
any.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Robert Bravery" wrote:
HI,

Thanks for all the answers, I think I got most of that.
I started a beginexecutereader, which makes a call to a SP, which does a
selec tinto, of about 40000 rows.
I notice that the rows are only "saved" once the endexecutrereader is called
and completed.
i can however moce the calling form around and do other things
Is this expected behavious.
I was hoping to show some progress of some kind to the user while the SP is
doing its insert.

Thanks

Robert

"Barry Kelly" <ba***********@gmail.comwrote in message
news:vn********************************@4ax.com...
"Robert Bravery" <me@u.comwrote:
Whats the differe between useing Executereader() and
Beginexecutereader()...endexecutereader() for asyncronys running of a SP
Just to add to what the other folks say: you don't necessarily have to
use a callback with BeginExecuteReader(). You might be using it to get
simple concurrency, to mask latency:

IAR result = Begin...
// do other work
// now ready to pick up where we left off
reader = End...(result)

-- Barry

--
http://barrkel.blogspot.com/


Jul 4 '06 #6

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

Similar topics

0
by: James Hokes | last post by:
Hi All, We're using the 1.1. Framework against SQL Server 2000, and are having a strange issue where we don't get errors back from the stored procedure, i.e. the exception never gets thrown. ...
1
by: Mark | last post by:
It appears that you can only retrieve an Output parameter from a SQL Server stored procedure when using the ExecuteNonQuery of the SqlCommand class, and cannot use the ExecuteReader() method. In...
6
by: BuddyWork | last post by:
Does anyone know if there are any articles explaining how I could debug into SqlCommand.ExecuteReader so I can see why I am getting a particular error. thanks
0
by: BuddyWork | last post by:
Hello, The problem is that when using SqlCommand.ExecuteReader and the SQL statement raises an error of severity of 16 then ExecuteReader throws an exception, when you use...
5
by: orencs | last post by:
Hello, I am using Microsoft.Practices.EnterpriseLibrary.Data. I am running the following sqlCommand = "SELECT var1 FROM table1 WHERE var2 IN (4,5,6) ; SELECT var3 FROM table2 WHERE var2 IN...
4
by: phil | last post by:
Hi, With the code below, i get the error: ExecuteReader: Connection property has not been initialized. Description: An unhandled exception occurred during the execution of the current web...
1
by: fniles | last post by:
I am using OLEDBDataReader to read from an Access database. I have 4 data source where I get my data from, and each data source is in its own thread. When receiving data, if it is a new...
7
by: fniles | last post by:
I am using VB.Net 2003 and MS Access (connecting using OleDBConnection). I read using DataAdapter and DataSet, not DataReader. When many people try to access the database at the same time, I get...
0
by: =?Utf-8?B?ZGF2ZQ==?= | last post by:
The following finishes in 1 hour instead of erroring after 1 second as expected. Dim cn As New System.Data.SqlClient.SqlConnection cn.ConnectionString = "Server=(local); Database=master; User...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.