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

sqlconnection open state

how to check the connection state sql

if (oconn.State.tostring()="Closed")

or is there a more approiate way
thanks
MJ
Apr 13 '07 #1
1 6302
or is there a more approiate way

How about:

if (oconn.State == ConnectionState.Closed)


--
Hope this helps.

Dan Guzman
SQL Server MVP

"Mike J" <ve***********@sbcglobal.netwrote in message
news:GR*****************@newssvr11.news.prodigy.ne t...
how to check the connection state sql

if (oconn.State.tostring()="Closed")

or is there a more approiate way
thanks
MJ

Apr 15 '07 #2

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

Similar topics

1
by: Skip Key | last post by:
While writing a windows service, I've run into a fairly strange problem. I have a worker proc that gets fired every n seconds using System.Threading.Timer. This works fine, unless I open an...
2
by: Carlos | last post by:
I would like to create a component that inherits from sqlconnection, but it is sealed. What ancestor can I inherit from? I've seen this: public sealed class SqlConnection : Component,...
1
by: Jaret Brower | last post by:
I have a SqlConnection object that in turn has a ConnectionString property set that includes a "pwd=password" in it. When I make the call SqlConnection.Open() and I later try to get the...
2
by: Sgt. Sausage | last post by:
New to multi-threading (less than 24 hours at it <grin>) Anyway, it's all making sense, and working fairly well thus far, but I'm having a minor issue I'm not sure how to get around. I've got...
0
by: BuddyWork | last post by:
I've noticed a difference in behaviour with the State property. Say we have an application connected and I then via Sql Server I kill the connection. When using OdbcConnection and you get the...
8
by: John J. Hughes II | last post by:
Is there a way of resetting the SqlConnection with closing/opening it again. I am not seeing anything called reset. Regards, John
4
by: Victor | last post by:
Hi Guys I have a problem here. I want to improve the performance for a website. When I looked into the system, I have found that the system made the "SqlConnection Object" static. That mean only...
4
by: Martin Arvidsson, Visual Systems AB | last post by:
Hi! I am currently developing my first webapplication using .net (2.x) In a couple examples seen in the helpfile that came with VS2008 i see that they are opening a connection to the sql...
2
by: Tony Johansson | last post by:
Hello! Just a simple question is it good to always close a sqlConnection even if the Connection has been closed by the DataAdapter ? //Tony
1
by: Tony Johansson | last post by:
Hello! Below is a simple program that works fine. In this program there is no explicit open for the SqlConnection instead the DataAdapter will open the Connection to the database automatically....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.