Kap*_*pil -4 c# namespaces using
我的代码没有编译给出错误:
找不到类型或命名空间名称"Int32"(您是否缺少using指令或程序集引用?)
为什么会发生这种情况/我该如何解决?
这是有问题的代码:
///***********************************************************
///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
}
Run Code Online (Sandbox Code Playgroud)
Cod*_*aos 12
该错误告诉您丢失,using System;因为该Int32类型是该命名空间的一部分.
///***********************************************************************using System;
Run Code Online (Sandbox Code Playgroud)
在您的代码中,您碰巧删除了换行符using System;.这使得它进入了被注释掉的前一行//.所以它也被注释掉了.
把它放在一个新的线上,问题就会消失.
///***********************************************************************
using System;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4972 次 |
| 最近记录: |