Click here to Skip to main content
15,913,055 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi.
I need to check the connection to Oracle Database.
I want to implement it on to c#.
Аdvise what to use for this?
Posted

Try to call the command line utility via the Process class and check the exit status of the utility in the process instance.

Cheers
Andi
 
Share this answer
 
you can check the state of your connection object, it will used to check connected or not...

like SQLConnection cs = new SQLConnection("YOUR CONNECTION STRING");
now check like this...
C#
if(cs!= null && cs.State == ConnectionState.Open)
{
   // your connection is working, means it will connected
   // do what you need your code goes here
}
 
Share this answer
 
Comments
[no name] 17-Jan-12 0:59am    
I use the second solution. Thank you for your reply!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900