Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 5:27am
konah579

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
0 OriginalGriff 7,645
1 DamithSL 5,614
2 Sergey Alexandrovich Kryukov 5,344
3 Maciej Los 4,961
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web03 | 2.8.141223.1 | Last Updated 31 May 2012
Copyright © CodeProject, 1999-2014
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