473,378 Members | 1,360 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.

telling when the db connection is retrieveing data

is there a way to tell when the database connection is retrieveing data? i
saw the connectionstate.fetching enumerated value, but of course it's not
implemented yet... is there another way to do this? thanks!
Nov 20 '05 #1
6 1309
hi,
try keep you connections closed, because ado.net opens connections
automatically (at least datadapters). so then just handle stat changing
event of your connections...

pavel

"Brian Henry" <br******@adelphia.net> píše v diskusním příspěvku
news:#u**************@TK2MSFTNGP11.phx.gbl...
is there a way to tell when the database connection is retrieveing data? i
saw the connectionstate.fetching enumerated value, but of course it's not
implemented yet... is there another way to do this? thanks!

Nov 20 '05 #2
Hi Brian,

What are you trying to achieve?

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

"Brian Henry" <br******@adelphia.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
is there a way to tell when the database connection is retrieveing data? i
saw the connectionstate.fetching enumerated value, but of course it's not
implemented yet... is there another way to do this? thanks!

Nov 20 '05 #3
I'm sorry but the disconnected archatecture doesn't work in the case of the
app i'm createing. I need a constant connection, because the information is
time sensative and can not wait for someone to push the data adapter's
update information to the database server... so i have to keep the
information constantly moveing in a connected state.. I just need to be able
to tell when the connection is bussy with a query, I thought putting a
"Bussy" text in the status bar would be nice so that the people can tell if
it is bussy on a big query. (we do very large queries, because this is a
very large insurance data processing application)
"Pavel KOHOUT" <ko****@advantages.cz> wrote in message
news:Oo****************@TK2MSFTNGP09.phx.gbl...
hi,
try keep you connections closed, because ado.net opens connections
automatically (at least datadapters). so then just handle stat changing
event of your connections...

pavel

"Brian Henry" <br******@adelphia.net> píše v diskusním příspěvku
news:#u**************@TK2MSFTNGP11.phx.gbl...
is there a way to tell when the database connection is retrieveing data? i saw the connectionstate.fetching enumerated value, but of course it's not implemented yet... is there another way to do this? thanks!


Nov 20 '05 #4
Brian:

I'm responding to your other post when I saw this one. They are two
seperate issues so I'm addressing them seperately. You mention not being
able to wait for data to be 'Push'ed but ADO.NET doesn't push data to the
user, in either connected or disconnected methodology.
I think you may be confused by the way ADO.NET works. Having a connection
'open' doesn't mean that you are getting up to the minute data. All it
means is that you have a connection open. You mention that you can't wait
for someone to push data down from there server, but ADO.NET and the
DataAdapter are Not Push objects. You have to query the DB either way to
get that data. Moreover, just because you leave a connection open doesn't
mean anything. You could use a DataAdapter and leave your connections open
just as easily as you can with a DataReader or Command.method (although you
don't want to do this).

My point is that if you want the most up to date data, you are going to have
to query the DB constantly. This is the same whether or not you leave a
connection open or close it immediately and it's going to be the same
regardless of which model you use. Your DB won't fire another query and give
you live data just b/c the connection is open.

I would also caution you that if your data is so time sensitive that you
need to refresh it constantly, you may cause yourself some serious
Performance Killing problems by leaving your connections open. Certainly
there will be lag time between queries (at a minimum it will take x amount
of time for the query to execute and you to respond to it). there are
occassions where you have a bunch of back to back operations and leaving a
connection open makes sense but those instances are rare and even then you
should still close the connection as soon as you are done with it.

And if your app is dealing with large amounts of data, I'd really advise
rethinking the methodology here because I doubt you'll be able to have an
app that is keeping really large amounts of data constantly up to date with
many users without some serious artillery. And even then I don't think
client side UI and Processing will lend itself well here.
"Brian Henry" <br******@adelphia.net> wrote in message
news:eM**************@TK2MSFTNGP09.phx.gbl...
I'm sorry but the disconnected archatecture doesn't work in the case of the app i'm createing. I need a constant connection, because the information is time sensative and can not wait for someone to push the data adapter's
update information to the database server... so i have to keep the
information constantly moveing in a connected state.. I just need to be able to tell when the connection is bussy with a query, I thought putting a
"Bussy" text in the status bar would be nice so that the people can tell if it is bussy on a big query. (we do very large queries, because this is a
very large insurance data processing application)
"Pavel KOHOUT" <ko****@advantages.cz> wrote in message
news:Oo****************@TK2MSFTNGP09.phx.gbl...
hi,
try keep you connections closed, because ado.net opens connections
automatically (at least datadapters). so then just handle stat changing
event of your connections...

pavel

"Brian Henry" <br******@adelphia.net> píše v diskusním příspěvku
news:#u**************@TK2MSFTNGP11.phx.gbl...
is there a way to tell when the database connection is retrieveing
data?
i saw the connectionstate.fetching enumerated value, but of course it's not implemented yet... is there another way to do this? thanks!



Nov 20 '05 #5
Hi Brian:
"Brian Henry" <br******@adelphia.net> wrote in message
news:#u**************@TK2MSFTNGP11.phx.gbl...
is there a way to tell when the database connection is retrieveing data? i
saw the connectionstate.fetching enumerated value, but of course it's not
implemented yet... is there another way to do this? thanks!


The Fetching and Busy are enumerations that aren't supported currently.
From what I understand, Fetching will only deal with Cursors as well, but
that's just scuttlebutt.

Anyway, you have connectionstate close and open. You can trap StateChanged
event. You can also raise an event within your own class that will signal
when everything is done..
http://www.knowdotnet.com/articles/connections.html

HTH,

Bill
Nov 20 '05 #6
no i do understand how ADO.net works i just didn't explain it good enough. I
ment that I need to make instantanious updates by useing command objects to
set the values on the server side.. and when ever i need to retrieve them do
it then from the server instead of catching data locally in datasets...
"William Ryan eMVP" <do********@comcast.nospam.net> wrote in message
news:ej****************@TK2MSFTNGP09.phx.gbl...
Brian:

I'm responding to your other post when I saw this one. They are two
seperate issues so I'm addressing them seperately. You mention not being
able to wait for data to be 'Push'ed but ADO.NET doesn't push data to the
user, in either connected or disconnected methodology.
I think you may be confused by the way ADO.NET works. Having a connection 'open' doesn't mean that you are getting up to the minute data. All it
means is that you have a connection open. You mention that you can't wait
for someone to push data down from there server, but ADO.NET and the
DataAdapter are Not Push objects. You have to query the DB either way to
get that data. Moreover, just because you leave a connection open doesn't
mean anything. You could use a DataAdapter and leave your connections open
just as easily as you can with a DataReader or Command.method (although you don't want to do this).

My point is that if you want the most up to date data, you are going to have to query the DB constantly. This is the same whether or not you leave a
connection open or close it immediately and it's going to be the same
regardless of which model you use. Your DB won't fire another query and give you live data just b/c the connection is open.

I would also caution you that if your data is so time sensitive that you
need to refresh it constantly, you may cause yourself some serious
Performance Killing problems by leaving your connections open. Certainly
there will be lag time between queries (at a minimum it will take x amount
of time for the query to execute and you to respond to it). there are
occassions where you have a bunch of back to back operations and leaving a
connection open makes sense but those instances are rare and even then you
should still close the connection as soon as you are done with it.

And if your app is dealing with large amounts of data, I'd really advise
rethinking the methodology here because I doubt you'll be able to have an
app that is keeping really large amounts of data constantly up to date with many users without some serious artillery. And even then I don't think
client side UI and Processing will lend itself well here.
"Brian Henry" <br******@adelphia.net> wrote in message
news:eM**************@TK2MSFTNGP09.phx.gbl...
I'm sorry but the disconnected archatecture doesn't work in the case of

the
app i'm createing. I need a constant connection, because the information

is
time sensative and can not wait for someone to push the data adapter's
update information to the database server... so i have to keep the
information constantly moveing in a connected state.. I just need to be

able
to tell when the connection is bussy with a query, I thought putting a
"Bussy" text in the status bar would be nice so that the people can tell

if
it is bussy on a big query. (we do very large queries, because this is a
very large insurance data processing application)
"Pavel KOHOUT" <ko****@advantages.cz> wrote in message
news:Oo****************@TK2MSFTNGP09.phx.gbl...
hi,
try keep you connections closed, because ado.net opens connections
automatically (at least datadapters). so then just handle stat changing event of your connections...

pavel

"Brian Henry" <br******@adelphia.net> píše v diskusním příspěvku
news:#u**************@TK2MSFTNGP11.phx.gbl...
> is there a way to tell when the database connection is retrieveing data?
i
> saw the connectionstate.fetching enumerated value, but of course

it's not
> implemented yet... is there another way to do this? thanks!
>
>



Nov 20 '05 #7

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

Similar topics

3
by: Eva | last post by:
hi, can anyone tell me how i can retrieve specific values from a listview? i have created 6 columns that will contain values that are added on an onclick event for a button. These values are...
26
by: Michel Rouzic | last post by:
I have a binary file used to store the values of variables in order to use them again. I easily know whether the file exists or not, but the problem is, in case the program has been earlier...
3
by: Nagash01WS6 | last post by:
Im working on writing an FTP application in C# to get a good feeling for the .NET language and how threading / networking classes all work. Thus far I have it working for the most part in PASV...
22
by: M K | last post by:
Heres my SP: ( i am trying to add more than 1 field but get the same error no matter how many i try to add, i thought i would try to insert the primary key only and work up from there but the...
0
by: phplasma | last post by:
Hey, I am currently attempting to implement a multi-threaded C# socket, using SSL (.pem file/certification/private key combo) server using Visual Studio C# Express. I have successfully made...
2
by: =?Utf-8?B?U3VuaWwgUGFuZGl0YQ==?= | last post by:
Hi All, I have created a VB.Net application that used classic ADO to access the oracle database. I have mentained a persistant connection in it. When i start the application and it works fine....
8
by: mark_aok | last post by:
Hi all, I have a split database. Both the forms, and the tables are stored on a shared network drive (this is Access 2003). The users use the forms, and the tables on the network drive, there...
1
by: svsenthilkumar | last post by:
how can i add 10 days with retrieveing date using php i retrieve a date from mysql table,and i add 10 days with that date and compare with today is or not.
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.