Simple.data and Connection closing

84 Views Asked by At

I am using simple.data with oracle managed data access .

https://github.com/SimonH/Simple.Data.Oracle

Currently there are too many connections are open and it is not closed properly in the server. Would like to how to close the same .

1

There are 1 best solutions below

0
Ray Bae On

Sure.

string constr = "user id=scott;password=tiger;data source=oracle";

OracleConnection con = new OracleConnection(constr);

con.Open();

// do stuff

con.Dispose();

This is a basic example of how to close the connection. Just dispose the object.