I have this c# application where the user needs to login through the first form. If validation returns true form2 opens up .
I want to maintain a single connection through all these forms with the same user credentials as entered in form1.I am using ODP.NET to connect to oracle 11g.
Thanks.
Sql connection in .NET is managed by connection pool. So if you instantiate new connection objects, it reuses old closed physical connection.
in form1
in form2
form1 and form2 use same physical connection to database
connection pooling also available for Oracle Data Provider
or maybe you interested in Entity Framework