编译器错误消息:CS0117 - 不包含定义不包含'Flag'的定义 - 对我来说任何一个帮助 [英] Compiler Error Message: CS0117 - does not contain a definition does not contain a definition for 'Flag' - any one help for me

查看:134
本文介绍了编译器错误消息:CS0117 - 不包含定义不包含'Flag'的定义 - 对我来说任何一个帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ShoppingHeart.BusinessLayer;
using System.Data;




namespace ShoppingHeart.Admin
{
    public partial class CustomerOrders : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GetOrderList();

            }

        }

       private void GetOrderList()

        {
            ShoppingCart k =new ShoppingCart

            {

                Flag=0

            };

            DataTable dt = k.GetOrderList();

            gvCustomerOrders.DataSource=dt;
            gvCustomerOrders.DataBind();
    }
    }
}

推荐答案

您的ShoppingCart没有Flag属性。 />
Your ShoppingCart has no "Flag" Property.
ShoppingCart k =new ShoppingCart

        {

            Flag=0

        };





(也许它不公开)



(Maybe its not public)


我认为它在我的环境中正常工作的代码没有问题。使用构建>>清洁解决方案并尝试。如果不起作用,请使用ILDASM.exe来监视shoppingcart类包含的属性标志。如果没有物理删除dll,请构建一次并再次添加。它的工作原理。



对于ILDASM exe,请在下面找到。

http://blogs.msdn.com/b/lucian/archive/2008/11/15 /where-are-the-sdk-tools-where-is-ildasm.aspx [ ^ ]
I think there is no issue with the code it is working fine in my environment. Using build>> clean solution and try. If it won't work use ILDASM.exe to watch the shoppingcart class contains the property flag. If not remove the dll physically, build once and add it again. it works.

For ILDASM exe find below.
http://blogs.msdn.com/b/lucian/archive/2008/11/15/where-are-the-sdk-tools-where-is-ildasm.aspx[^]


这篇关于编译器错误消息:CS0117 - 不包含定义不包含'Flag'的定义 - 对我来说任何一个帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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