Hi All, I had high hopes of doing great things but its nearly beat me and the answer must be oh so simple.
Setup:
TimeTracker Installed
.NET 2.0
Visual Web Studio 2005 express
IIS 6
TimeTracker Database hosted on MSSQL Server 2005
Run aspnet_regsql.exe to register sql server
ISSUE:
- launch timetracker from visual web (F5) - this work fine and presents long/create user page
- Try to logon with valid user and receive message 'Your login attempt was not successful. Please try again.' All user logons fail with this message. BUT......
- Choose to create user, go to create user page, create user and this works fine. Can see all my users in the database on the SQL Server.
- Click the continue button from the create user page and get the following error:
- SQL Server enabled for remote connections. Surface area tool rerun.....
Maybe useful detail
- Server also runs two other named MSSQL Server 2000 instances
- The MSSQL 2005 server being used for timetracker is also a named instance
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces,
error: 26 - Error Locating Server/Instance Specified)
Have built a few post/response data website in asp in the past I thought getting to grips with ASP.NET would not be to hard....its killing me....nearly 21 hours solid an got nowhere...someone please save a dumb bloke.
Thanks for the response. I'm using a single server that is hosting Visual Web Developer, MSSQL 2005 Sever Standard & IIS. Ran through the steps you recommend prior to your post, unfortunately did not resolve the issue. Ran through them again for good measure.
.
When i run SQLProfiler I can see the database level user 'timetracker' from the web.config connection string logging into the server. However the only function I can perform is to create a new user from the default page. As part of the create user process the
'choose role page' appears intermittently. Most the time it does not appear, When I click continue button after creating the user the following error occurs:
--- An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces,
error: 26 - Error Locating Server/Instance Specified) ---
The below is a trace as I added user jim. From I can see database connectivity is working I still get the above error.
The SQLTrace has many connection resets...
exec dbo.aspnet_UsersInRoles_GetRolesForUser @ApplicationName=N'/',@UserName=N'jim'
go
exec sp_reset_connection
go
declare @p12 uniqueidentifier
set @p12='AAF8F63D-FB63-4208-88FB-7AFC8D385E26'
exec dbo.aspnet_Membership_CreateUser
@ApplicationName=N'/',@UserName=N'ben',@Password=N'jYIeXsN2AJ3ivopH8/EnWthGm/Y=',@PasswordSalt=N'ooLhAcyGuTfc3s4d4Sgq3w==',@Email=N'ben@test.com',@PasswordQuestion=N'van',@PasswordAnswer=N'LB1M4y5vTwAvz1xoEgIpWOpaccM=',@IsApproved=1,@UniqueEmail=0,@PasswordFormat=1,@CurrentTimeUtc='2009-01-12
11:49:34:000',@UserId=@p12 output
select @p12
go
exec sp_reset_connection
go
exec dbo.aspnet_UsersInRoles_GetRolesForUser @ApplicationName=N'/',@UserName=N'jim'
go
exec sp_reset_connection
go
exec dbo.aspnet_UsersInRoles_GetRolesForUser @ApplicationName=N'/',@UserName=N'jim'
go
exec sp_reset_connection
go
exec dbo.aspnet_UsersInRoles_AddUsersToRoles @ApplicationName=N'/',@RoleNames=N'ProjectAdministrator',@UserNames=N'ben',@CurrentTimeUtc='2009-01-12 11:49:43:540'
go
exec sp_reset_connection
go
exec dbo.aspnet_UsersInRoles_AddUsersToRoles @ApplicationName=N'/',@RoleNames=N'ProjectManager',@UserNames=N'ben',@CurrentTimeUtc='2009-01-12 11:49:44:257'
go
exec sp_reset_connection
go
exec dbo.aspnet_UsersInRoles_AddUsersToRoles @ApplicationName=N'/',@RoleNames=N'Consultant',@UserNames=N'ben',@CurrentTimeUtc='2009-01-12 11:49:44:273'
go
exec sp_reset_connection
go
exec dbo.aspnet_UsersInR
Could this be a problem with aspnetdb ? The very first time the aspnet_regsql tool was run it created aspnetdb. After following another post it was run again against the TimeTracker database. Users ASP.NET and timetracker both been given permissions to the
aspnetdb & TimeTracker and added to all the asp roles in those databases.
pottierm
0 Points
2 Posts
Cannot logon to application,but can create users (MSSQL 2005 Server config)
Jan 11, 2009 12:53 PM|LINK
Setup:
TimeTracker Installed
.NET 2.0
Visual Web Studio 2005 express
IIS 6
TimeTracker Database hosted on MSSQL Server 2005
Run aspnet_regsql.exe to register sql server
Connection string amended in web.config
connectionStrings
add name="aspnet_staterKits_TimeTracker" connectionString="Server=SQLSERVERNAME\INSTANCENAME;Database=timetracker;User ID=timetracker;Password=Passw0rd" providerName="System.Data.SqlClient" />
/connectionStrings
ISSUE:
- launch timetracker from visual web (F5) - this work fine and presents long/create user page
- Try to logon with valid user and receive message 'Your login attempt was not successful. Please try again.' All user logons fail with this message. BUT......
- Choose to create user, go to create user page, create user and this works fine. Can see all my users in the database on the SQL Server.
- Click the continue button from the create user page and get the following error:
- SQL Server enabled for remote connections. Surface area tool rerun.....
Maybe useful detail
- Server also runs two other named MSSQL Server 2000 instances
- The MSSQL 2005 server being used for timetracker is also a named instance
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Have built a few post/response data website in asp in the past I thought getting to grips with ASP.NET would not be to hard....its killing me....nearly 21 hours solid an got nowhere...someone please save a dumb bloke.
Regards & Thanks
chetan.sarod...
All-Star
66619 Points
11270 Posts
Re: Cannot logon to application,but can create users (MSSQL 2005 Server config)
Jan 12, 2009 02:23 AM|LINK
Set Try to set Data Source = "Server name" in connection string
Open "SQL Server Surface Area Configuration"
then opne the "Surface Area Configuartion for Services and Connections "
Under the Remote connection u have to enable the "Using both TCP/IP and Named Pipes "
then It will work..
Try to set Data Source= "serverName" in you connectionString
Data Source=.\SQLEXPRESS will work only on local m/c, It will not work if you host your site
Check in web.config for connectionString, configure it according to your server name, password etc.
In Time Tracking System, it uses inbuild Membership classes for user creation, updation etc..
You have to register your DB with ASP.NET Membership classes by executing the command line utility in VS prompt
aspnet_regsql, it will open one window, where you have to configure DB.
Hope it will help you, let me know.
Hope it will help you, let me know.
http://forums.asp.net/t/1260556.aspx
http://forums.asp.net/t/913172.aspx
http://forums.asp.net/t/1008091.aspx
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
pottierm
0 Points
2 Posts
Re: Cannot logon to application,but can create users (MSSQL 2005 Server config)
Jan 12, 2009 11:39 AM|LINK
Here are my connection strings again
web.config connectionStrings>
add name="aspnet_staterKits_TimeTracker" connectionString="Server=SBMTSQL1\MSSSQL2005;Initial Catalog=TimeTracker;User ID=timetracker;Password=Passw0rd" providerName="System.Data.SqlClient"
/connectionStrings
machine.config
connectionStrings
add name="LocalSqlServer" connectionString="data source=SBMTSQL1\MSSQL2005;initial catalog=TimeTracker;User ID=timetracker;Password=Passw0rd" providerName="System.Data.SqlClient"/
/connectionStrings
When i run SQLProfiler I can see the database level user 'timetracker' from the web.config connection string logging into the server. However the only function I can perform is to create a new user from the default page. As part of the create user process the 'choose role page' appears intermittently. Most the time it does not appear, When I click continue button after creating the user the following error occurs:
--- An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) ---
The below is a trace as I added user jim. From I can see database connectivity is working I still get the above error.
The SQLTrace has many connection resets...
exec dbo.aspnet_UsersInRoles_GetRolesForUser @ApplicationName=N'/',@UserName=N'jim'
go
exec sp_reset_connection
go
declare @p12 uniqueidentifier
set @p12='AAF8F63D-FB63-4208-88FB-7AFC8D385E26'
exec dbo.aspnet_Membership_CreateUser
@ApplicationName=N'/',@UserName=N'ben',@Password=N'jYIeXsN2AJ3ivopH8/EnWthGm/Y=',@PasswordSalt=N'ooLhAcyGuTfc3s4d4Sgq3w==',@Email=N'ben@test.com',@PasswordQuestion=N'van',@PasswordAnswer=N'LB1M4y5vTwAvz1xoEgIpWOpaccM=',@IsApproved=1,@UniqueEmail=0,@PasswordFormat=1,@CurrentTimeUtc='2009-01-12 11:49:34:000',@UserId=@p12 output
select @p12
go
exec sp_reset_connection
go
exec dbo.aspnet_UsersInRoles_GetRolesForUser @ApplicationName=N'/',@UserName=N'jim'
go
exec sp_reset_connection
go
exec dbo.aspnet_UsersInRoles_GetRolesForUser @ApplicationName=N'/',@UserName=N'jim'
go
exec sp_reset_connection
go
exec dbo.aspnet_UsersInRoles_AddUsersToRoles @ApplicationName=N'/',@RoleNames=N'ProjectAdministrator',@UserNames=N'ben',@CurrentTimeUtc='2009-01-12 11:49:43:540'
go
exec sp_reset_connection
go
exec dbo.aspnet_UsersInRoles_AddUsersToRoles @ApplicationName=N'/',@RoleNames=N'ProjectManager',@UserNames=N'ben',@CurrentTimeUtc='2009-01-12 11:49:44:257'
go
exec sp_reset_connection
go
exec dbo.aspnet_UsersInRoles_AddUsersToRoles @ApplicationName=N'/',@RoleNames=N'Consultant',@UserNames=N'ben',@CurrentTimeUtc='2009-01-12 11:49:44:273'
go
exec sp_reset_connection
go
exec dbo.aspnet_UsersInR
Could this be a problem with aspnetdb ? The very first time the aspnet_regsql tool was run it created aspnetdb. After following another post it was run again against the TimeTracker database. Users ASP.NET and timetracker both been given permissions to the aspnetdb & TimeTracker and added to all the asp roles in those databases.
Any support greatly appreciated.
chetan.sarod...
All-Star
66619 Points
11270 Posts
Re: Cannot logon to application,but can create users (MSSQL 2005 Server config)
Jan 15, 2009 02:26 AM|LINK
http://blogs.msdn.com/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx
http://blogs.msdn.com/sql_protocols/archive/2005/11/14/492616.aspx
http://blogs.msdn.com/sql_protocols/archive/2005/10/22/sql-server-2005-connectivity-issue-troubleshoot-part-i.aspx
Have a look at the following KB article, it will take you through the process of allowing remote connections.
How to configure SQL Server 2005 to allow remote conections
http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277
http://blogs.msdn.com/sql_protocols/archive/2007/03/31/named-pipes-provider-error-40-could-not-open-a-connection-to-sql-server.aspx
http://blogs.msdn.com/sql_protocols/archive/2007/05/13/sql-network-interfaces-error-26-error-locating-server-instance-specified.aspx
Make sure your connection string is correct.
http://support.microsoft.com/default.aspx/kb/914277
http://forums.asp.net/p/1156144/1898826.aspx
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.