注册 登录
编程论坛 ASP.NET技术论坛

谁能帮我看看这个问题?

byp2011 发布于 2011-10-10 16:54, 672 次点击
“/”应用程序中的服务器错误。
--------------------------------------------------------------------------------

编译错误
说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。

编译器错误消息: ASPNET: 请确保此代码文件中定义的类与“inherits”属性匹配,并且该类扩展的基类(例如 Page 或 UserControl)是正确的。

源错误:

 

行 15: namespace first
行 16: {
行 17:     public partial class login : System.Web.UI.Page
行 18:     {
行 19:         protected void Page_Load(object sender, EventArgs e)
 

源文件: d:\weblx\first\first\login.aspx.cs    行: 17

代码:
using System;
using System.Collections;
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.OracleClient;

namespace first
{
    public partial class login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string userName = Request.Form["username"].ToString();
            string userPwd = Request.Form["userpwd"].ToString();
            oracleConnection con =new oracleConnection("Provider=MSDASQL.1;Password=cy0610;Persist Security Info=True;User ID=cy06dba;Data Source=cy06dba;");
            //string ConnectionString = "Data Source=cy6;user=cy06dba;password=zyytcy06;";//写连接串
            //OracleConnection conn = new OracleConnection(ConnectionString);//创建一个新连接
            con.open();
            //OracleCommand cmd = conn.CreateCommand();
            OracleCommand cmd = new OracleCommand ("select count(*) from dbausr where name='" + userName + "' and pwd='" + userPwd + "'", con);
            int count = Convert.Toint32(cmd.ExecuteScalar());
            if (count > 0)
            {
                Response.Redirect("main.aspx");

            }
            else
            {
                Response.Redirect("loginFail.htm");

            }
        }

    }
}
2 回复
#2
jalonlovesja2011-10-11 11:34
一步一步调试了。
OracleCommand ("觉得这个括号不对了
#3
dotnetcode2011-10-17 11:54
是不是接受用户名和密码有问题 打断点调试
1