Các bạn cho mình hỏi đây là lỗi j vậy và ai chỉ hộ mình cách sửa đc ko :
Code:
Keyword not supported: 'sever'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Keyword not supported: 'sever'.
Source Error:
Line 18: {
Line 19: string ketnoi = "Sever=Data Source=.\\HoangIT;Initial Catalog=QuanLy;User ID=sa;Password=***********";
Line 20: SqlConnection conn = new SqlConnection(ketnoi);
Line 21: try
Line 22: {
Source File: c:\Users\HoangKute\Documents\Visual Studio 2010\WebSites\WebSite1\Default.aspx.cs Line: 20
Stack Trace:
[ArgumentException: Keyword not supported: 'sever'.]
System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) +5055124
System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) +98
System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +64
System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +24
System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +150
System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +59
System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +4
System.Data.SqlClient.SqlConnection..ctor(String connectionString) +26
_Default.Page_Load(Object sender, EventArgs e) in c:\Users\HoangKute\Documents\Visual Studio 2010\WebSites\WebSite1\Default.aspx.cs:20
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
Còn đây là đoạn mã mình viết :
Code:
protected void Page_Load(object sender, EventArgs e)
{
string ketnoi = "Sever=Data Source=.\\HoangIT;Initial Catalog=QuanLy;User ID=sa;Password=***********";
SqlConnection conn = new SqlConnection(ketnoi);
try
{
conn.Open();
Label1.Text = "ket noi ko thanh cong";
}
catch
{
Label1.Text = "Ket noi thanh cong";
}
Mong các pro giúp hộ mình