I have project on C# on VS2008. When i try to open connection to oracle from static constructor of static class i have Exception "Server did not respond within the specified timeout interval". Whan I do this from static member of static class all work fine. How can I open connection to oracle from static constructor of static class?
This code raice exception:
static class ERPDB
{
static int a;
public static void tst()
{
a = 1;
}
static ERPDB()
{
string myConnectionString = "User Id=S;Password=s;Data Source=10.1.1.1;SID=TT";
OracleConnection myConn = new OracleConnection(myConnectionString);
myConn.Open();
}
}
I call ERPDB.tst();
This code work fine:
static class ERPDB
{
static int a;
public static void tst()
{
a = 1;
string myConnectionString = "User Id=S;Password=s;Data Source=10.1.1.1;SID=TT";
OracleConnection myConn = new OracleConnection(myConnectionString);
myConn.Open();
}
static ERPDB()
{
}
}
I call ERPDB.tst();
OracleConnection for Windows Mobile
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48