Click here to Skip to main content
15,892,768 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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

1 solution

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:

C#
namespace demo
{
   public string myData { get; set; }

   public class myClass
   {
   }

}


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

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

}
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900