编译项目时的错误 [英] Mistake when compiling project

查看:98
本文介绍了编译项目时的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表单,连接到数据库Oracle.
我使用数据集XSD文件,从数据库中放置tableadapters,

当我编译项目时出现错误

错误名称空间不能直接包含诸如字段或方法之类的成员"

我使用了namespace,这可以帮助我以表单的形式从XSD.dataset访问tableadapters

为了连接到Oracle,我使用Oracle.DataAccess.Client ....

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....

推荐答案

该错误似乎指出了您的问题.听起来您已经在类定义之外放置了方法或属性.例如,这是错误的:

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; }
   }

}


这篇关于编译项目时的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆