C# 找不到类型或命名空间名称“Int32”(是否缺少using指令或程序集引用?)
我的代码未编译,出现以下错误: 找不到类型或命名空间名称“Int32”是否缺少using指令或程序集引用 为什么会发生这种情况/如何解决 以下是相关代码:C# 找不到类型或命名空间名称“Int32”(是否缺少using指令或程序集引用?),c#,namespaces,using,C#,Namespaces,Using,我的代码未编译,出现以下错误: 找不到类型或命名空间名称“Int32”是否缺少using指令或程序集引用 为什么会发生这种情况/如何解决 以下是相关代码: ///*********************************************************** ///Author Name: Harkamal Singh ///Creation Date: 17th Nov, 2008 ///File Name: CountryPrp.cs Component
///***********************************************************
///Author Name: Harkamal Singh
///Creation Date: 17th Nov, 2008
///File Name: CountryPrp.cs Component Used:
///Called From: Business Logic Layer
///Description: Class File For Booking Functionality
///Tables Accessed:
///Program specs:
///UTP doc:
///Tested By:
///***********************************************************************
///Modification History:
///Change No. Changed By Date Version Raised By/SRS No Description
///***********************************************************************using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// Summary description for CountryPrp
/// </summary>
namespace BLL
{
public class CountryPrp
{
public CountryPrp()
{
//
// TODO: Add constructor logic here
//
}
#region tCountryPropertyClass
private Int32 iCountryId;
private String sCountryName;
private DateTime dtCreated;
private DateTime dtModified;
private Int32 iCreatedBy;
private Int32 iModifiedBy;
private Boolean bisActive;
private Char sOperationType;
private Int16 iReturnid;
public Int32 p_iCountryId
{
get
{
return iCountryId;
}
set
{
iCountryId = value;
}
}
public String p_sCountryName
{
get
{
return sCountryName;
}
set
{
sCountryName = value;
}
}
public DateTime p_dtCreated
{
get
{
return dtCreated;
}
set
{
dtCreated = value;
}
}
public DateTime p_dtModified
{
get
{
return dtModified;
}
set
{
dtModified = value;
}
}
public Int32 p_iCreatedBy
{
get
{
return iCreatedBy;
}
set
{
iCreatedBy = value;
}
}
public Int32 p_iModifiedBy
{
get
{
return iModifiedBy;
}
set
{
iModifiedBy = value;
}
}
public Boolean p_bisActive
{
get
{
return bisActive;
}
set
{
bisActive = value;
}
}
public Char p_sOperationType
{
get
{
return sOperationType;
}
set
{
sOperationType = value;
}
}
public Int16 p_iReturnid
{
get
{
return iReturnid;
}
set
{
iReturnid = value;
}
}
#endregion
}
错误告诉您缺少使用系统;因为Int32类型是该命名空间的一部分
///***********************************************************************using System;
在代码中,您在使用System;之前碰巧删除了换行符;。这使它移到前面用//注释掉的一行。所以它也被注释掉了
换一条新线路,问题就会解决
///***********************************************************************
using System;
找不到类型或命名空间名称“Question”。您缺少一个实际问题。我加了一个。如果它不代表您想问的问题,请在您的真实问题中进行编辑。此外,您确实需要阅读.NET命名约定指南。您不应该使用匈牙利符号,而属性使用p_u前缀是我见过的最丑陋的事情。@CodesInChaos现在有一个问题,应该重新打开,不是吗?