I'm trying to connect to an Access database in ASP.NET 1.1. I'm using the following code:
I get the following error:
With the line that defines myConnection highlighted. I'm not sure what's wrong with my definition.
Code:
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=calendar.mdb";
OleDbConnection myConnection = new OleDbConnection(connectionString);
I get the following error:
Code:
field initializer cannot reference the nonstatic field, method, or property 'ASP.CalendarTest_20070117_aspx.connectionString'
With the line that defines myConnection highlighted. I'm not sure what's wrong with my definition.