Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
The check is done over the enumeration type:if(con.State == ConnectionState.Open){}Regards
7 Jun 2011Ravi Sharma 2 7 alternatives
With what code can I check if my connection in C# to Oracle is open? I want a message to display if the connection is open or close.I use web based applicatio with oracle connectionI use below code but i got error "Operator '==' cannot be applied to operands of type...
30 Jan 2014DanielSanDiego
Try this....Using System.Dataif(Con.State == ConnectionState.Open){}
you can also try if (con.State.ToString() == "Open") { lable1.text = "Connection is Open"; } else { lable1.text = "Connection is close"; }
hello friend i solved your problem in few second Your question is " how to connect sql server with vb.net"Soln:- you add following cede in your project at the load_Form. Class Firstdim ds as new datasetdim dr as datareaderdim cb as commandBuilderdim da as dataadapterpublic...
Hi Check the connection object != nothing before trying to open the connection.Hope this helps.
27 Oct 2015Member 11013956
if connection is closed whether if we want to reopen the connection then we can write like this if (OraCon.State == ConnectionState.Closed) OraCon.Open();
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.