编译器错误消息: CS0117: “Entity.PaperByRandomSelection”并不包含“SingleSelectionSum_1”的定义
using System;using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using Entity;
using BLL;
protected void btnSave_Click(object sender, EventArgs e)
{
try
{
PaperByRandomSelection paper = new PaperByRandomSelection();
paper.JudgeSum = Convert.ToInt32(txtJudgeSum.Text);
paper.SingleSelectionSum = Convert.ToInt32(txtSingleSelectionSum.Text);//单选题(数)
paper.SingleSelectionSum_1 = Convert.ToInt32(txtSingleSelectionSum_1.Text);
paper.MultiSelectionSum = Convert.ToInt32(txtMultiSelectionSum.Text);
......
————————————————————————————————————————————————————————
PaperByManualSelection.cs页
————————————————————————————————————————————————————————
using System;
using System.Collections.Generic;
using System.Text;
namespace Entity
{
/// <summary>
/// 随机抽题的试卷
/// </summary>
public class PaperByRandomSelection : PaperByManualSelection
{
/// <summary>
/// 单选题1数量
/// </summary>
public int SingleSelectionSum { get; set; }
/// <summary>
/// 单选题2数量
/// </summary>
public int SingleSelectionSum_1 { get; set; }
/// <summary>
/// 单选题3数量
/// </summary>
public int SingleSelectionSum_2 { get; set; }
......
——————————————————————————————————————————————————————
运行后错误提示
——————————————————————————————————————————————————————
“/Web”应用程序中的服务器错误。
--------------------------------------------------------------------------------
编译错误
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。
编译器错误消息: CS0117: “Entity.PaperByRandomSelection”并不包含“SingleSelectionSum_1”的定义
源错误:
行 44: paper.JudgeSum = Convert.ToInt32(txtJudgeSum.Text);
行 45: paper.SingleSelectionSum = Convert.ToInt32(txtSingleSelectionSum.Text);//单选题(数)
行 46: paper.SingleSelectionSum_1 = Convert.ToInt32(txtSingleSelectionSum_1.Text);
行 47: paper.MultiSelectionSum = Convert.ToInt32(txtMultiSelectionSum.Text);
行 48: paper.PaperName = txtPaperName.Text;
源文件: c:\Users\Administrator\Documents\Visual Studio 2010\WebSites\TestOnLine10\Web\Tester\AddPaperByRandomSelection1.aspx.cs 行: 46
显示详细的编译器输出:
C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0> "C:\Windows\\Framework\v2.0.50727\csc.exe" ...
Microsoft (R) Visual C# 2005 编译器 版本 8.00.50727.4927
用于 Microsoft (R) Windows (R) 2005 Framework 版本 2.0.50727
版权所有(C) Microsoft Corporation 2001-2005。保留所有权利。
c:\Users\Administrator\Documents\Visual Studio 2010\WebSites\TestOnLine10\Web\Tester\AddPaperByRandomSelection1.aspx.cs(46,19): error CS0117: “Entity.PaperByRandomSelection”并不包含“SingleSelectionSum_1”的定义
显示完整的编译源:
...
--------------------------------------------------------------------------------
版本信息: Microsoft .NET Framework 版本:2.0.50727.4963; 版本:2.0.50727.4955
小弟刚接触这种方式、请教个位高手不是在PaperByManualSelection.cs页面定义吗?为什么不管用呢?
[ 本帖最后由 zhang9825472 于 2011-12-22 09:40 编辑 ]