并不包含对“CustomerId”的定义
public DataSet GetOrderHistory( int customerId )
{
GWTrace.EnteringMethod( MethodBase.GetCurrentMethod());
OrderHistory oh = new OrderHistory();
oh.CustomerId = customerId;
SqlPersistenceContainer spc = new SqlPersistenceContainer(CMPConfigurationHandler.ContainerMaps["OrderHistory"]);
spc.Select(oh);
oh.FinalizeData();
return oh.ResultSet;
}
------------------------------------------------------------------------------------
错误提示:“Shop.OrderHistory”并不包含对“CustomerId”的定义
下面是OrderHistory.cs
using System;
using System.Data;
using System.Reflection;
using System.Diagnostics;
using System.Xml;
using System.Xml.Serialization;
using Shop.CMPServices;
using Shop.MonitorServices;
using Shop.MonitorServices.Logging;
namespace Shop.OrdersClient.Data
{
/// <summary>
/// Summary description for OrderHistory.
/// </summary>
public class OrderHistory : PersistableObjectSet
{
private int customerId;
public OrderHistory()
{
//
// TODO: Add constructor logic here
//
}
public int CustomerId
{
get
{
return customerId;
}
set
{
customerId = value;
}
}
}
}
谁能帮帮忙,头晕了,不知道怎么回事。谢了
问题点数:100、回复次数:4Top
1 楼wangyingbobj2911(不帅)回复于 2004-12-03 17:44:54 得分 10
帮顶把。不会。关注Top
2 楼Eddie005(♂) №.零零伍 (♂)回复于 2004-12-03 17:49:18 得分 40
你肯定有重名的类,并且在shop命名空间里,从错误提示:“Shop.OrderHistory”并不包含对“CustomerId”的定义可以看出来;
改成:
Shop.OrdersClient.Data.OrderHistory oh = new Shop.OrdersClient.Data.OrderHistory();
Top
3 楼goody9807(http://goody9807.cnblogs.com)回复于 2004-12-03 17:59:44 得分 30
Shop.OrderHistory里面有CustomerId这个属性吗
还是有重名的类Top
4 楼xxuu503(中国没有prison break只是因为the company不让拍)回复于 2004-12-03 18:46:36 得分 20
两位楼上说的都对
你给出的类是Shop.OrdersClient.Data.OrderHistory
而提示是Shop.OrderHistory没有属性
肯定是你的命名空间搞错了Top
相关问题
- “string”并不包含对“ToInt32”的定义
- System.Data.SqlClient.SqlCommand”并不包含对“Execute”的定义
- “System.Web.UI.WebControls.Image”并不包含对“src”的定义,怎么回事?
- E:\mydotnet\mypj1\index.aspx.cs(35): “System.Data.SqlClient.SqlCommand”并不包含对“Execute”的定义
- CS0117: “int”并不包含对“FromString”的定义
- System.Data.SqlClient.SqlCommand 并不包含对“Fill”的定义,怎么解决?
- 这样定义对吗
- 用户自定义对象
- 这样的定义对吗!??
- 对象定义问题




