UPDATE: Error was caused by a class named the OleDbConnection hiding the OleDbConnection constructors and therefore not presenting the overload method.
I am in the early stages of learning how to use ole database connections however I have run into a probem straight away. Despite there being an overload method to create an OleDbConnection connection it simply wont allow me to pass a connection string in.
Heres what I am trying.
private OleDbConnection _myConnection = null;
public bool CreateConnection()
{
try
{
_myConnection = new OleDbConnection(ConfigurationManager.ConnectionStrings["OracleDefault"].ConnectionString);
}
catch (Exception e)
{
throw new Exception(e.Message);
}
return true;
}
Now there doesn't seem to be anything wrong with that however I get an error saying that the method has 0 parameters but is invoked with 1 argument. I have seen countless examples showing it done in this way but for some reason it just won't let me do it. Any ideas?
UPDATE: Removed the semi colon as it wasnt supposed to be in the example I posted however this is not the issue. It simply won't accept any form of string.