小弟从CSDN的下载频道内弄到一套源码,修改完毕后出现登陆无法打开数据库.
本人半路出家,小小新人一个.请教各位这个问题的解决办法. 附上源码包.房屋销售管理系统(c#源码).rar
附件上传超时,只好放到外部连接上

解决方案 »

  1.   

    man慢慢的理解慢慢的搞 就好了
      

  2.   

    你的数据库中有'HouseDB'吗?
    看这个函数
    public bool Logins()
    {
       string  ishave="select * from login where LoginName=@name and LoginPwd=@pwd";
       SqlCommand cmd=this._con.CreateCommand();
       cmd.CommandText=ishave;
       cmd.Parameters.Add("@name",this._login.LoginName);
       cmd.Parameters.Add("@pwd",this._login.LoginPwd);
    try
    {
    this._con.Open();
    SqlDataReader reader=cmd.ExecuteReader();
    if(reader.Read())
    {
    this._isLogin=true;
    }
    }
    catch(Exception ex)
    {
    Console.WriteLine(ex.Message);
    throw ex;
    }
    finally
    {
     this._con.Close();
    }
    return this._isLogin;
    }
      

  3.   

    数据库连接的地方在这里。
    public ConDA()
    {
    this._con=new SqlConnection("server=.;database=HouseDB;integrated security=sspi");
    }
    首先确保你的数据库中有表HouseDB并且字段也要正确。如果有请贴出来错误提示。准确的错误提示。