不支持关键字: “attachdbfile name”。
不支持关键字: “attachdbfile name”。 说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.ArgumentException: 不支持关键字: “attachdbfile name”。
源错误:
行 32: }
行 33: string ConnSql = ConfigurationManager.ConnectionStrings["ConnString"].ToString();
行 34: SqlConnection Conn = new SqlConnection(ConnSql);
行 35: Conn.Open();
行 36: string StrinSQL = "select * from users where userid='" + txtid.Text + "' and userpwd='" + txtpassword.Text + "'";
源文件: c:\Users\delll\Desktop\新建文件夹 (3)\用户登录.aspx.cs 行: 34
堆栈跟踪:
[ArgumentException: 不支持关键字: “attachdbfile name”。]
System.(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +4909748
System.(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +55
System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24
System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +200
System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +62
System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4
System.Data.SqlClient.SqlConnection..ctor(String connectionString) +24
Default2.Unnamed1_Click(Object sender, EventArgs e) in c:\Users\delll\Desktop\新建文件夹 (3)\用户登录.aspx.cs:34
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565