首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >实例化类问题的c#

实例化类问题的c#
EN

Stack Overflow用户
提问于 2011-09-10 02:22:09
回答 2查看 245关注 0票数 0

我正在尝试实例化类:

代码语言:javascript
复制
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using RadarGraphInsertDLL;


namespace EnterData.DataEntry
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void gaia_lom_Inserting(object sender, SqlDataSourceCommandEventArgs e)
        {

        }

        protected void SubmitData(object sender, EventArgs e)
        {
            LOMDLL.Main_Lom_Form MainLomFormTable = PopulateMainForm();
            IList<LOMDLL.Lom_Batch> BatchTable = PopulateBatchTable();
            IList<LOMDLL.Lom_Problem> ProblemTable = PopulateProblemTable();
            IList<LOMDLL.Lom_Specimen> SpecimenTable = PopulateSpecimenTable();
        }


    }
}

但是得到这个错误:

代码语言:javascript
复制
Error   19  The type name 'Main_Lom_Form' does not exist in the type 'EnterData.DataEntry.WebForm1.LOMDLL'  C:\Documents and Settings\agordon\My Documents\Visual Studio 2008\Projects\lomdb\EnterData\DataEntry\DAL.cs 64  55  EnterData

但我确实有这些!

代码语言:javascript
复制
public class Main_Lom_Form
{
    public int lom_number {get;set;}
    public DateTime occurrence_date {get;set;}
    public DateTime report_date {get;set;}
    public string report_by {get;set;}
    public string identified_by {get;set;}
    public string section_c_issue_error_identified_by{get;set;}
    public string section_c_comments{get;set;}
    public string section_d_investigation{get;set;}
    public string section_e_corrective_action{get;set;}
    public string section_f_comments{get;set;}
    public string pre_practice_code{get;set;}
    public string pre_contact{get;set;}
}
public class Lom_Batch
{
    public int lom_number { get; set; }
    public string batch { get; set; }
}
public class Lom_Problem
{
    public int lom_number { get; set; }
    public string problem { get; set; }
}
public class Lom_Specimen
{
    public int lom_number { get; set; }
    public string specimen { get; set; }
}

我不能实例化类的原因是什么?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-09-10 12:44:45

您没有给我们提供编译器错误消息的完整列表。没有它我们真的帮不了什么忙。你不知道问题是什么,所以选择你分享的线索是不明智的

票数 1
EN

Stack Overflow用户

发布于 2011-09-10 02:23:59

我假设这里还有其他的编译器错误,你没有展示给我们。从类定义中删除static关键字。你不能实例化一个静态类。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7365856

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档