estou recebendo um
'ConnectionString' lançou uma exceção do tipo 'System.Configuration.ConfigurationErrorsException'
cada vez que tento executar meu WinForm.
Alguma idéia de como resolvê-lo?
Este é o meu código C#:
public class DB
{
/// <summary>
///
/// </summary>
public static string ConnectionString
{
get
{
string connStr = ConfigurationManager.ConnectionStrings["Stoica Mihai"].ConnectionString;
OracleConnectionStringBuilder sb = new OracleConnectionStringBuilder(connStr);
//sb.ApplicationName = ApplicationName ?? sb.ApplicationName;
//sb.ConnectTimeout = (ConnectionTimeout > 0) ? ConnectionTimeout : sb.ConnectTimeout;
return sb.ToString();
}
}
/// <summary>
/// Returns an opened connection to the database
/// </summary>
/// <returns></returns>
public static OracleConnection GetSqlConnection()
{
OracleConnection conn = new OracleConnection(ConnectionString);
conn.Open();
return conn;
}
/// <summary>
/// Override the connection timeout
/// </summary>
public static int ConnectionTimeout { get; set; }
/// <summary>
/// Used to override the name of the application
/// </summary>
public static string ApplicationName { get; set; }
}