我有一个包含以下代码的文件:
namespace A
{
public enum DT
{
Byte = 0,SByte = 1,BCD8 = 2,Int16 = 3,UInt16 = 4,BCD16 = 5,Int32 = 6,UInt32 = 7,BCD32 = 8,Single = 9,String = 10,Structure = 11,WString = 12
}
}
在我的WebForm1.aspx.cs文件中,我想使用上面代码中的元素。我的WebForm1.aspx.cs看起来像:
using A;
namespace SComm
{
public partial class WebForm1 : system.web.UI.Page
{
protected void Page_Load(object sender,EventArgs e)
{
}
protected void Button1_Click(object sender,EventArgs e)
{
A.DT tData = new A.DT.Int16;
//some other code
}
}
}
我收到错误CS0426:
“类型DT中不存在类型Int16”
我想是因为名称空间不同。我该怎么办才能解决此错误?