Click here to Skip to main content
12,297,976 members (54,568 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# Oracle database
I have a form, connecting to database Oracle.
I use a dataset XSD file, on which I put tableadapters from database,

When I compiling project appears a mistake

"Error A namespace cannot directly contain members such as fields or methods"

I used namespace , which helps me to access tableadapters from XSD.dataset in my form

for connect to Oracle i use Oracle.DataAccess.Client....
Posted 31-May-12 4:27am
konah603

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

The error seems to point out your problem. It sounds like you have placed a method or a property outside of a class definition. For example, this is wrong:

namespace demo
{
   public string myData { get; set; }
 
   public class myClass
   {
   }
 
}

You would need to move your property inside your class like so:

namespace demo
{
   public class myClass
   {
      public string myData { get; set; }
   }
 
}
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 31 May 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100