问题比较急,重新发下,请大家帮帮忙!CS0246: 找不到类型或命名空间名称“DataAcess”(是否缺少 using 指令或程序集引)
using System;using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string strcmd = "";
int i;
DataAcess mydataAcess = new DataAcess( );
if (TextBox1.Text.Trim() != "" && TextBox2.Text.Trim() != "")
{
if (DropDownList1.Text == "管理员")
{
strcmd = "select count(*) from admin where 用户名='" + TextBox1.Text + "' and 密码='" + TextBox2.Text + "'";
temp = 1;
}
if (DropDownList1.Text == "教师")
{
strcmd = "select count(*) from teacher where 教师编号='" + TextBox1.Text + "' and 密码='" + TextBox2.Text + "'";
temp = 2;
}
if (DropDownList1.Text == "学生")
{
strcmd = "select count(*) from student where 学号='" + TextBox1.Text + "' and 密码='" + TextBox2.Text + "'";
temp = 3;
}
i = mydataAcess.ExecuteScalar(strcmd);
if (i == 1)
{
Session["Username"] = TextBox1.Text.ToString();
if (temp == 1)
Response.Redirect("Default.aspx");
if (temp == 2)
Response.Redirect("Default2.aspx");
if (temp == 3)
Response.Redirect("Default3.aspx");
}
else
Response.Write("<script LANGUAGE='javascript'>alert('账号或密码错误!');history.go(-1);</script>");
}
else
{
Response.Write("<script LANGUAGE='javascript'>alert('请输入账号或密码!');history.go(-1);</script>");
TextBox1.Text = "";
TextBox2.Text = "";
}
}
}
CS0246: 找不到类型或命名空间名称“DataAcess”(是否缺少 using 指令或程序集引)
请大家帮帮忙!O(∩_∩)O谢谢!
--------------------编程问答-------------------- 你的工程上没有DataAcess这个自定义的类,或者没有引用这个类的命名空间 --------------------编程问答-------------------- DataAcess 在那里定义的,添加引用
using 命名空间; --------------------编程问答--------------------
具体怎么操作,这方面不是很懂。能说下嘛?O(∩_∩)O谢谢
补充:.NET技术 , ASP.NET