Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Beginner Question

Thread Tools

Beginner Question

Ted C Ted C is offline
Junior Member
Join Date: Oct 2006
Location: Nashville, TN
Posts: 2
I'm trying to connect to an Access database in ASP.NET 1.1. I'm using the following 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:

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.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginner's Beginner william nelson Ruby 7 04-11-2011 11:23 PM
beginner's question.. Scott Needham Wireless Networking 4 09-06-2005 12:52 AM
No Class at ALL!!! beginner/beginner question =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?= ASP .Net 7 02-03-2005 02:47 PM
Tutorial for beginner/ Tutorial voor beginner Rensjuh C++ 7 09-02-2004 12:41 AM
Beginner question: What trigs processes Jerker Hammarberg VHDL 16 07-22-2003 03:58 PM