//I am using sql server 2000 and i have changed the connectionString setting to localhost below: //I got this error while running. Server Error in '/WebSite3' Application. Invalid value for key 'attachdbfilename'. 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: Invalid value for key 'attachdbfilename'. Source Error: Line
5: void Application_Start(object sender, EventArgs e) { Line 6: SiteMap.SiteMapResolve += new SiteMapResolveEventHandler(AppendQueryString); Line 7: if (!Roles.RoleExists("Administrators")) Roles.CreateRole("Administrators"); Line 8: if (!Roles.RoleExists("Friends"))
Roles.CreateRole("Friends"); Line 9: } Source File: c:\Documents and Settings\Manish Saini\My Documents\Visual Studio 2005\Projects\WebSite3\Global.asax Line: 7 Stack Trace: [ArgumentException: Invalid value for key 'attachdbfilename'.] System.Data.SqlClient.SqlConnectionString.VerifyLocalHostAndFixup(String&
host, Boolean enforceLocalHost, Boolean fixup) +299 System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +2960 System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +46
System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +201 System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +82
System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +28 System.Data.SqlClient.SqlConnection..ctor(String connectionString) +35 System.Web.DataAccess.SqlConnectionHolder..ctor(String connectionString) +68 [ArgumentException: An error occurred
while attempting to initialize a System.Data.SqlClient.SqlConnection object. The value that was provided for the connection string may be wrong, or it may contain an invalid syntax. Parameter name: connectionString] System.Web.DataAccess.SqlConnectionHolder..ctor(String
connectionString) +160 System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +127 System.Web.Security.SqlRoleProvider.RoleExists(String roleName) +612 System.Web.Security.Roles.RoleExists(String roleName)
+70 ASP.global_asax.Application_Start(Object sender, EventArgs e) in c:\Documents and Settings\Manish
Marked as answer by Nidhi2008 on Mar 18, 2009 07:23 PM
//I am using sql server 2000 and i have changed the connectionString setting to localhost below: //I got this error while running. Server Error in '/WebSite3' Application. Invalid value for key 'attachdbfilename'. 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: Invalid value for key 'attachdbfilename'. Source Error: Line
5: void Application_Start(object sender, EventArgs e) { Line 6: SiteMap.SiteMapResolve += new SiteMapResolveEventHandler(AppendQueryString); Line 7: if (!Roles.RoleExists("Administrators")) Roles.CreateRole("Administrators"); Line 8: if (!Roles.RoleExists("Friends"))
Roles.CreateRole("Friends"); Line 9: } Source File: c:\Documents and Settings\Manish Saini\My Documents\Visual Studio 2005\Projects\WebSite3\Global.asax Line: 7 Stack Trace: [ArgumentException: Invalid value for key 'attachdbfilename'.] System.Data.SqlClient.SqlConnectionString.VerifyLocalHostAndFixup(String&
host, Boolean enforceLocalHost, Boolean fixup) +299 System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +2960 System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous) +46
System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(String connectionString, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions& userConnectionOptions) +201 System.Data.SqlClient.SqlConnection.ConnectionString_Set(String value) +82
System.Data.SqlClient.SqlConnection.set_ConnectionString(String value) +28 System.Data.SqlClient.SqlConnection..ctor(String connectionString) +35 System.Web.DataAccess.SqlConnectionHolder..ctor(String connectionString) +68 [ArgumentException: An error occurred
while attempting to initialize a System.Data.SqlClient.SqlConnection object. The value that was provided for the connection string may be wrong, or it may contain an invalid syntax. Parameter name: connectionString] System.Web.DataAccess.SqlConnectionHolder..ctor(String
connectionString) +160 System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +127 System.Web.Security.SqlRoleProvider.RoleExists(String roleName) +612 System.Web.Security.Roles.RoleExists(String roleName)
+70 ASP.global_asax.Application_Start(Object sender, EventArgs e) in c:\Documents and Settings\Manish
You should investigate what the connection string should be like:
1) Create an empty text file in windows explorer and rename it to X.UDL
2) Double click on it and the data-link provider dialogue will appear.
3) Select the provider tab. Find the provider for SQL Server and click next.
4) Select your database
5) Test the connection and save it.
6) Compare the contents of X.UDL with your connections string.
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
Marked as answer by Nidhi2008 on Mar 18, 2009 07:23 PM
Data-link provider does not show SQL Server in the list. List contain following providers. 1.Microsoft OLE DB Provider for SQL server 2.SQL Native Client 3.SQL Server Replication OLE DB Provider for DTS
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
Marked as answer by Nidhi2008 on Mar 25, 2009 10:22 PM
Nidhi2008
Member
3 Points
15 Posts
I have a quick question
Mar 02, 2009 10:01 PM|LINK
Nidhi2008
Member
3 Points
15 Posts
I have a quick question
Mar 02, 2009 10:55 PM|LINK
Nidhi2008
Member
3 Points
15 Posts
I have a quick question
Mar 02, 2009 10:56 PM|LINK
web.config
TATWORTH
All-Star
72415 Points
14017 Posts
MVP
Re: I have a quick question
Mar 04, 2009 03:33 PM|LINK
You should investigate what the connection string should be like:
1) Create an empty text file in windows explorer and rename it to X.UDL
2) Double click on it and the data-link provider dialogue will appear.
3) Select the provider tab. Find the provider for SQL Server and click next.
4) Select your database
5) Test the connection and save it.
6) Compare the contents of X.UDL with your connections string.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
Nidhi2008
Member
3 Points
15 Posts
Re: I have a quick question
Mar 04, 2009 06:59 PM|LINK
TATWORTH
All-Star
72415 Points
14017 Posts
MVP
Re: I have a quick question
Mar 04, 2009 08:51 PM|LINK
Use 1.Microsoft OLE DB Provider for SQL server
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239