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 4:27am
konah566

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
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 375
1 Abhinav S 333
2 OriginalGriff 330
3 sanket saxena 305
4 CPallini 205
0 Sergey Alexandrovich Kryukov 8,497
1 OriginalGriff 4,850
2 Peter Leow 3,839
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web01 | 2.8.140415.2 | Last Updated 31 May 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid