请教一个简单的问题,在线期待
我用asp.net web matrix 写了一个aspx文件
<%@ Page Language="C#" %>
<%@ import Namespace="System.Data.SqlClient" %>
<%@ import Namespace="Service.Class.Data" %>
<%@ import Namespace="Service.Info.GetInfo" %>
<%@ import Namespace="Service.Vo" %>
<%@ import Namespace="System.Collections" %>
<script runat="server">
// Insert page code here
//
public void Page_Load()
{
if(Request.QueryString["ID"]=="new")
{
Label_TopText.Text="Add New Customer";
}
else
{
Label_TopText.Text="Customer Info";
string id=Request.QueryString["ID"];
CustomersVo customer=this.GetCustomerInfoById(id);
Text_ID=customer.SetAndGetCustomerID();
}
}
public CustomersVo GetCustomerInfoById(string id)
{
ArrayList list=new GetCustomerInfo().GetAllInfoById(id);
CustomersVo customer=list[0];
return customer;
}
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:Label id="Label_TopText" runat="server" Font-Bold="true" Font-Size="10" Font-Names="Tahoma"></asp:Label>
<br />
<hr />
<asp:Label id="Label_ID" runat="server" Font-Size="10" Font-Names="Tahoma" Text="ID: "></asp:Label>
<asp:Label id="Text_ID" runat="server" Font-Size="10" Font-Names="Tahoma"></asp:Label>
<br />
<asp:Label id="Label_Name" runat="server" Font-Size="10" Font-Names="Tahoma" Text="Name: "></asp:Label>
<asp:TextBox id="TextBox_Name" runat="server" Font-Size="10" Font-Names="Tahoma" BorderStyle="Groove" MaxLength="20"></asp:TextBox>
<br />
<asp:Label id="Label_Phone" runat="server" Font-Size="10" Font-Names="Tahoma" Text="Phone: "></asp:Label>
<asp:TextBox id="TextBox_Phone" runat="server" Font-Size="10" Font-Names="Tahoma" BorderStyle="Groove" MaxLength="20"></asp:TextBox>
<br />
<asp:Label id="Label_Address" runat="server" Font-Size="10" Font-Names="Tahoma" Text="Address: "></asp:Label>
<asp:TextBox id="TextBox_Address" runat="server" Font-Size="10pt" Font-Names="Tahoma" BorderStyle="Groove" MaxLength="30" Width="176px"></asp:TextBox>
<br />
<asp:Label id="Label_Text" runat="server" Font-Size="10" Font-Names="Tahoma" Text="Info: "></asp:Label>
<asp:TextBox id="TextBox_Text" runat="server" Font-Size="10pt" Font-Names="Tahoma" BorderStyle="Groove" MaxLength="50" Width="201px" Height="80px" TextMode="MultiLine"></asp:TextBox>
<br />
<br />
<asp:Button id="Button_OK" runat="server" Font-Size="10" Font-Names="Tahoma" Text="OK" Width="70"></asp:Button>
</form>
</body>
</htm
另外有一个类
// SqlConnection.cs
//
namespace Service.Class.Data
{
using System;
using System.Data.SqlClient;
/// <summary>
/// Summary description for SqlConnection.
/// </summary>
public class SqlConnection
{
private System.Data.SqlClient.SqlConnection conn;
private string SqlConnectionString;
/// <summary>
/// Creates a new instance of SqlConnection
/// </summary>
public SqlConnection()
{
SqlConnectionString="user id=sa;password=;initial catalog=Service;data source=kaer;";
}
public SqlConnection getConnect()
{
conn=new SqlConnection();
conn.Open();
return conn;
}
}
}
每次报错:
编译错误
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。
编译器错误信息: CS0246: 找不到类型或命名空间名称“Service”(是否缺少 using 指令或程序集引用?)
源错误:
行 1: <%@ Page Language="C#" %>
行 2: <%@ import Namespace="System.Data.SqlClient" %>
行 3: <%@ import Namespace="Service.Class.Data" %>
行 4: <%@ import Namespace="Service.Info.GetInfo" %>
行 5: <%@ import Namespace="Service.Vo" %>
源文件: C:\Inetpub\wwwroot\Service\Customers.aspx 行: 3