Beginner Question

Discussion in '.NET' started by Ted C, Jan 22, 2007.

  1. Ted C

    Ted C

    Joined:
    Oct 11, 2006
    Messages:
    2
    Location:
    Nashville, TN
    I'm trying to connect to an Access database in ASP.NET 1.1. I'm using the following code:

    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.
     
    Ted C, Jan 22, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jerker Hammarberg

    Beginner question: What trigs processes

    Jerker Hammarberg, Jul 17, 2003, in forum: VHDL
    Replies:
    16
    Views:
    1,627
    Mike Treseler
    Jul 22, 2003
  2. smu
    Replies:
    3
    Views:
    2,639
    shobhit24
    Jun 28, 2006
  3. =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=

    No Class at ALL!!! beginner/beginner question

    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=, Feb 2, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    591
    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=
    Feb 3, 2005
  4. Rensjuh
    Replies:
    7
    Views:
    977
    Mabden
    Sep 2, 2004
  5. william nelson

    Beginner's Beginner

    william nelson, Apr 11, 2011, in forum: Ruby
    Replies:
    7
    Views:
    223
    7stud --
    Apr 12, 2011
Loading...

Share This Page