I have SQL Server 2005 Developer Edition installed as an instance (computername\SQLServer2005) as the default one is SQL Server 2000. Now i changed the web.config as follows: connectionString="Data
Source=computername\SQLServer2005; (here computername is my local machine name)
This solved the following error:
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) .
Then when i start the Time Tracker project I get error:
Exception Details: System.Data.SqlClient.SqlException: The user instance login flag is not supported on this version of SQL Server. The connection will be closed.
On one of the forum posting someone mentioned to run C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe (something about allowing SQL Server 2005 to create databases from an ASP.net app which Developer/Standard Edition doesn't
support unlike SQL Express Edition). Anyway after running it a new DB was created in my SQL Server 2005 instance -
aspnetdb. As part of the creation i choose Windows Authentication since i have mixed mode support in my DB (so Windows Authentication works when i use SQL Management Studio) and i figured it should work here. But when i start the Time Tracker
app in Visual Web Developer 2005 Express Edition it still causes the error
Exception Details: System.Data.SqlClient.SqlException: The user instance login flag is not supported on this version of SQL Server. The connection will be closed.
I don't even see the timetracker database as being created in SQL 2005. When i had tested this app with SQL Express on another machine it created this DB in SQL Express. But i cannot get it to do the same for this SQL Server 2005 Developer Edition instance. My
web.config section is shown below:
Any suggestions would be appreciated. As you notice I'm a complete novice in programming and maybe intermediate in SQL Server so please give detailed steps if possible
The aspnet_regsql was used as stated in the original post which resulted in the aspnetdb Database being created. Also as you said i checked the Remote Connections and they have been already enabled for TCP/IP in the surface configuration. I didn't provide
username/password becuase as mentioned i do have Windows Authentication supported in SQL Server so shouldn't 'Integrated Security=True;' work. Again please see the web.config snippet below:
The error is the same although i did notice at the bottom it mentions global.asax. Does this help anyway?
Server Error in '/TimeTracker1' Application.
--------------------------------------------------------------------------------
The user instance login flag is not supported on this version of SQL Server. The connection will be closed.
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.Data.SqlClient.SqlException: The user instance login flag is not supported on this version of SQL Server. The connection will be closed.
Source Error:
Line 9: ' Code that runs on application startup
Line 10: If Roles.Enabled Then
Line 11: If (Not Roles.RoleExists("ProjectAdministrator")) Then
Line 12: Roles.CreateRole("ProjectAdministrator")
Line 13: End If
Source File: C:\Documents and Settings\feleve\My Documents\Visual Studio 2005\WebSites\TimeTracker1\global.asax Line:
11
So at this point I think i tried both of your suggestions but still the same results. Any further help would be appreciated.
I'm not sure how you manage to connect to the correct database, you should also supply the database name in you connectionString, so add:
Database=NameOfDb if it's not supplied somewhere else.
The error you're getting might be becuase the correct asp.net membership tables haven't been installed in you db.
Not really sure here, since the error message you're getting is about user instances, and you say they're turned on.
Ok so i was going to try the suggestion to attach the timetracker.mdf file which came with this starter kit but it does not include a .ldf. Because of this reason the database does not attach. I was thinking of running the timetracker-add.sql file but
when i opened it there is no mention of creating a database named Timetracker. Since SQL Management Studio requires it to be run against a database, these database objects will end up being created for whatever DB i pick.
Am i supposed to forget about the timetracker.mdf which came with this kit and just create an empty database named 'timetracker' and just run this script against it? And if so, what is the purpose of the lone database file - timetracker.mdf which came
with this starter kit?
Don't really remember if I ran it against an empty db that I intended to use for the timeTracker project (named whatever just referenced correctly in the web.config), or just attached the file in SQL.
I think either way works.
It's possible attach mdf without the ldf's, poke around some.
Ok this is really strange i was able to get past the error "The user instance login flag is not supported on this version of SQL Server. The connection will be closed." by just changing the Connection String in web.config as follows:
Note the only thing I did was changed 'User Instance=false' from 'true'. Nothing else. Then when i started the site it created a database but used the whole path as part of the database name. So my dbname is C:\DOCUMENTS AND SETTINGS\username\MY DOCUMENTS\VISUAL
STUDIO 2005\WEBSITES\TIMETRACKER1\APP_DATA\TIMETRACKER.MDF. But hey it works now and I can login. I tried changing it to just 'timetracker' but it failed so I left it this way. Not sure how to change the name to just 'timetracer' without making the rest
of the App fail.
Anyway those who are getting this error, please try just changing the web.config as i did above.
Hope this helps.
Marked as answer by thomassamson on Jan 11, 2008 03:45 PM
thomassamson
Member
7 Points
10 Posts
Need help with install on SQL Server 2005 Developer Edition
Dec 27, 2007 10:20 PM|LINK
Hi,
This solved the following error:I have SQL Server 2005 Developer Edition installed as an instance (computername\SQLServer2005) as the default one is SQL Server 2000. Now i changed the web.config as follows: connectionString="Data Source=computername\SQLServer2005; (here computername is my local machine name)
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) .
Then when i start the Time Tracker project I get error:
Exception Details: System.Data.SqlClient.SqlException: The user instance login flag is not supported on this version of SQL Server. The connection will be closed.
On one of the forum posting someone mentioned to run C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe (something about allowing SQL Server 2005 to create databases from an ASP.net app which Developer/Standard Edition doesn't support unlike SQL Express Edition). Anyway after running it a new DB was created in my SQL Server 2005 instance - aspnetdb. As part of the creation i choose Windows Authentication since i have mixed mode support in my DB (so Windows Authentication works when i use SQL Management Studio) and i figured it should work here. But when i start the Time Tracker app in Visual Web Developer 2005 Express Edition it still causes the error
Exception Details: System.Data.SqlClient.SqlException: The user instance login flag is not supported on this version of SQL Server. The connection will be closed.
I don't even see the timetracker database as being created in SQL 2005. When i had tested this app with SQL Express on another machine it created this DB in SQL Express. But i cannot get it to do the same for this SQL Server 2005 Developer Edition instance. My web.config section is shown below:
<connectionStrings>
<add name="aspnet_staterKits_TimeTracker" connectionString="Data Source=computername\SQLServer2005;Integrated Security=True;AttachDBFilename=|DataDirectory|TimeTracker.mdf;User Instance=true"/>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=computername\SQLServer2005;Integrated Security=True;AttachDBFilename=|DataDirectory|TimeTracker.mdf;User Instance=true"/>
</connectionStrings>
Any suggestions would be appreciated. As you notice I'm a complete novice in programming and maybe intermediate in SQL Server so please give detailed steps if possible
Thank you.
utlandsfanto...
Participant
1736 Points
565 Posts
Re: Need help with install on SQL Server 2005 Developer Edition
Dec 28, 2007 02:01 AM|LINK
Try removing "AttachDBFilename=|DataDirectory|TimeTracker.mdf;" from your web.config.
An example, but that's without integrated security. Anyhow you would have to specify the Db name:
<
add name="connStringName" connectionString="Data Source=COMPUTERNAME\SQLINSTANCE;User ID=UID;Password='PWD';Database=NameOfDb;Trusted_Connection=False;" providerName="System.Data.SqlClient" />Hope this helps.
Cheers!
/Eskil
chetan.sarod...
All-Star
66619 Points
11270 Posts
Re: Need help with install on SQL Server 2005 Developer Edition
Dec 28, 2007 02:32 AM|LINK
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.
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
thomassamson
Member
7 Points
10 Posts
Re: Need help with install on SQL Server 2005 Developer Edition
Dec 28, 2007 05:29 PM|LINK
Hi Chetan, utlandsfantomenno1
The aspnet_regsql was used as stated in the original post which resulted in the aspnetdb Database being created. Also as you said i checked the Remote Connections and they have been already enabled for TCP/IP in the surface configuration. I didn't provide username/password becuase as mentioned i do have Windows Authentication supported in SQL Server so shouldn't 'Integrated Security=True;' work. Again please see the web.config snippet below:
<connectionStrings>
<add name="aspnet_staterKits_TimeTracker" connectionString="Data Source=RELSEC_FE\SQLServer2005;Integrated Security=True;AttachDBFilename=|DataDirectory|TimeTracker.mdf;User Instance=true"/>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=RELSEC_FE\SQLServer2005;Integrated Security=True;AttachDBFilename=|DataDirectory|TimeTracker.mdf;User Instance=true"/>
</connectionStrings>
I tried the suggestion to remove AttachDBFilename=|DataDirectory|TimeTracker.mdf;" (see below how it looks with this change)
<connectionStrings>
<add name="aspnet_staterKits_TimeTracker" connectionString="Data Source=RELSEC_FE\SQLServer2005;Integrated Security=True;User
Instance=true"/>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=RELSEC_FE\SQLServer2005;Integrated Security=True;User Instance=true"/>
</connectionStrings>
The error is the same although i did notice at the bottom it mentions global.asax. Does this help anyway?
Server Error in '/TimeTracker1' Application.
--------------------------------------------------------------------------------
The user instance login flag is not supported on this version of SQL Server. The connection will be closed.
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.Data.SqlClient.SqlException: The user instance login flag is not supported on this version of SQL Server. The connection will be closed.
Source Error:
Source File: C:\Documents and Settings\feleve\My Documents\Visual Studio 2005\WebSites\TimeTracker1\global.asax Line: 11
So at this point I think i tried both of your suggestions but still the same results. Any further help would be appreciated.
utlandsfanto...
Participant
1736 Points
565 Posts
Re: Need help with install on SQL Server 2005 Developer Edition
Dec 28, 2007 07:23 PM|LINK
I'm not sure how you manage to connect to the correct database, you should also supply the database name in you connectionString, so add: Database=NameOfDb if it's not supplied somewhere else.
The error you're getting might be becuase the correct asp.net membership tables haven't been installed in you db.
Not really sure here, since the error message you're getting is about user instances, and you say they're turned on.
Either way, have a look at this post http://forums.asp.net/t/913172.aspx since that migth straighten thing out.
Cheers!
/Eskil
thomassamson
Member
7 Points
10 Posts
Re: Need help with install on SQL Server 2005 Developer Edition
Dec 28, 2007 08:48 PM|LINK
Ok so i was going to try the suggestion to attach the timetracker.mdf file which came with this starter kit but it does not include a .ldf. Because of this reason the database does not attach. I was thinking of running the timetracker-add.sql file but when i opened it there is no mention of creating a database named Timetracker. Since SQL Management Studio requires it to be run against a database, these database objects will end up being created for whatever DB i pick.
Am i supposed to forget about the timetracker.mdf which came with this kit and just create an empty database named 'timetracker' and just run this script against it? And if so, what is the purpose of the lone database file - timetracker.mdf which came with this starter kit?
utlandsfanto...
Participant
1736 Points
565 Posts
Re: Need help with install on SQL Server 2005 Developer Edition
Dec 28, 2007 09:05 PM|LINK
Don't really remember if I ran it against an empty db that I intended to use for the timeTracker project (named whatever just referenced correctly in the web.config), or just attached the file in SQL.
I think either way works.
It's possible attach mdf without the ldf's, poke around some.
Cheers!
/Eskil
thomassamson
Member
7 Points
10 Posts
Re: Need help with install on SQL Server 2005 Developer Edition
Dec 28, 2007 09:10 PM|LINK
Ok this is really strange i was able to get past the error "The user instance login flag is not supported on this version of SQL Server. The connection will be closed." by just changing the Connection String in web.config as follows:
<connectionStrings>
<add name="aspnet_staterKits_TimeTracker" connectionString="Data Source=RELSEC_FE\SQLServer2005;Integrated Security=True;AttachDBFilename=|DataDirectory|TimeTracker.mdf;User Instance=false"/>
<remove name="LocalSqlServer"/>
<add name="LocalSqlServer" connectionString="Data Source=RELSEC_FE\SQLServer2005;Integrated Security=True;AttachDBFilename=|DataDirectory|TimeTracker.mdf;User Instance=false"/>
</connectionStrings>
Note the only thing I did was changed 'User Instance=false' from 'true'. Nothing else. Then when i started the site it created a database but used the whole path as part of the database name. So my dbname is C:\DOCUMENTS AND SETTINGS\username\MY DOCUMENTS\VISUAL STUDIO 2005\WEBSITES\TIMETRACKER1\APP_DATA\TIMETRACKER.MDF. But hey it works now and I can login. I tried changing it to just 'timetracker' but it failed so I left it this way. Not sure how to change the name to just 'timetracer' without making the rest of the App fail.
Anyway those who are getting this error, please try just changing the web.config as i did above.
Hope this helps.
chetan.sarod...
All-Star
66619 Points
11270 Posts
Re: Need help with install on SQL Server 2005 Developer Edition
Jan 14, 2008 02:34 AM|LINK
You replied as "The error you're getting might be becuase the correct asp.net membership tables haven't been installed in you db"
In my post I mentioned the utility aspnet_regsql
This is helpful to install membership table
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.