sudhakar amalraj

sudhakar amalraj

  • NA
  • 6
  • 17.1k

Stackoverflow Exception was unhandled

Sep 9 2014 2:11 AM
class BaseData
{
public string DbConnection = ConfigurationManager.ConnectionStrings["OLTPPOINTER_Connectionstring"].ConnectionString;
public string DbConnection_Report = ConfigurationManager.ConnectionStrings["OLTPPOINTER_Connectionstring"].ConnectionString;
protected SqlConnection OpenConnection()
{
SqlConnection conn = new SqlConnection(DbConnection);
try
{
if (conn.State != ConnectionState.Open)
{
conn.Open();
}
return conn;
}
catch { throw; }
}
I use recursive call,it works fine in sometime.
But in Sometime it throws an Exception in  
SqlConnection conn = new SqlConnection(DbConnection); 
or
adpt.Fill(ds, "DataSet");