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.
Thank you but the issue has already been solved per the instructions in my post above. All i had to do was change the web.config file and make User Instance=false for the connection string part. Hope this helps others who are running into this issue.
SQL Server Express - SQL Server Standard - SQL Server Developer.
Problem Solved: Difficulty - Medium.
Assumption: More than one SQL Server Instance and version are runnintg. Your most likely trying to connect to a SQL Server Express MDF file The solution below is viable if your running more robust versions of SQL Server and working with
an express database.
Resolution:
1) Check your running processes & instances (2000, 20005 Standard, 2005 Express). If you see only one instance and version, the instructions below are worthless.
2) Shut down SQL Server Express.
3) Create a database, don't fret over the name. This can be handled in your config files and from management studio.
4) Restore your new database fromthe MDF\LDF files.
5) Check your machine config (1 & 2). Change the connection string "LocalSQLServer". You can build the connnection string from Studio 2005\2008.
6) Change you machine config &\or web.config to use the new connection string. Choose the correct provider.
7) Stop SQL Server Express - put it into manual mode & keep it that way.
8) If your working with the asp_net databae, you ,may want to put that into your machine config.
I have read about two or three other options for dealing with this problem. I am not sure why it has become so cumbersome. Hint - understand the error message before applying any changes. Don't trust the blogs at face value. The
flags are sent to the engine when started. You can start a trace if it's still being problematic.
The full version of SQL Server doesn't support creating [user instance] 'attached' databases like sql express does (it looks like the connection string is intended for sql express).
create and use the database on your sql server.
then use a connection string something like: "server=localhost;database=TimeTracker;uid=sa;pwd=.." (or use integrated security)
For SQL Server 2008 Developer Edition, I found that when I got that particular error while trying to run example code I downloaded from the ASP.Net Dynamic Data Futures project, all I had to do was find all occurrences of the following:
DataSource=.\sqlexpress;User Instance=True;
and change them to the following:
DataSource=.; <-- notice I simply removed User Instance = rather than set it to False
Once I did the above, everything worked fine for me. My environment:
<div mce_keep="true">Windows XP Pro SP3</div>
<div mce_keep="true">SQL Server 2008 Developer Edition with both a default instance and a second named instance called sqlexpresss</div>
<div mce_keep="true">.Net Framework 3.5 SP1</div>
<div mce_keep="true">Visual Studio Team System 2008 Development Edition</div>
Hope this helps anybody dealing with sample code pulled down from the internet that don't want to install SQL Server 2008 Express in addition to Sql Server 2008 Developer Edition.
thomassamson
Member
7 Points
10 Posts
Re: Error Message: The user instance login flag is not supported on this version of SQL Server. ...
Dec 31, 2007 08:12 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
65839 Points
11163 Posts
Re: Error Message: The user instance login flag is not supported on this version of SQL Server. ...
Jan 03, 2008 02:27 AM|LINK
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. So that necessary table, SP will be automatically included in your 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: Error Message: The user instance login flag is not supported on this version of SQL Server. ...
Jan 03, 2008 02:55 PM|LINK
Hi chetan,
Thank you but the issue has already been solved per the instructions in my post above. All i had to do was change the web.config file and make User Instance=false for the connection string part. Hope this helps others who are running into this issue.
Thanks.
chetan.sarod...
All-Star
65839 Points
11163 Posts
Re: Error Message: The user instance login flag is not supported on this version of SQL Server. ...
Jan 16, 2008 02:28 AM|LINK
If issue is solved then please mark it as answer,
So it will help to people
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
jlccd@sbcglo...
Member
2 Points
1 Post
Solution - The user instance login flag is not supported on this version of SQL Server - Solutio...
Jan 21, 2008 02:37 AM|LINK
SQL Server Express - SQL Server Standard - SQL Server Developer.
Problem Solved: Difficulty - Medium.
Assumption: More than one SQL Server Instance and version are runnintg. Your most likely trying to connect to a SQL Server Express MDF file The solution below is viable if your running more robust versions of SQL Server and working with an express database.
Resolution:
1) Check your running processes & instances (2000, 20005 Standard, 2005 Express). If you see only one instance and version, the instructions below are worthless.
2) Shut down SQL Server Express.
3) Create a database, don't fret over the name. This can be handled in your config files and from management studio.
4) Restore your new database fromthe MDF\LDF files.
5) Check your machine config (1 & 2). Change the connection string "LocalSQLServer". You can build the connnection string from Studio 2005\2008.
6) Change you machine config &\or web.config to use the new connection string. Choose the correct provider.
7) Stop SQL Server Express - put it into manual mode & keep it that way.
8) If your working with the asp_net databae, you ,may want to put that into your machine config.
I have read about two or three other options for dealing with this problem. I am not sure why it has become so cumbersome. Hint - understand the error message before applying any changes. Don't trust the blogs at face value. The flags are sent to the engine when started. You can start a trace if it's still being problematic.
Cheers
Jeff Damukaitis
"Solution" "instance login flag
chetan.sarod...
All-Star
65839 Points
11163 Posts
Re: Solution - The user instance login flag is not supported on this version of SQL Server - Sol...
Jan 23, 2008 02:24 AM|LINK
Just change in web.config as User Instance=false
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
ed_ward_grah...
Member
104 Points
172 Posts
Re: Error Message: The user instance login flag is not supported on this version of SQL Server. ...
Sep 15, 2008 03:54 PM|LINK
Three years on and your reply is still proving useful! Thanks very much, Scott.
chetan.sarod...
All-Star
65839 Points
11163 Posts
Re: Error Message: The user instance login flag is not supported on this version of SQL Server. ...
Sep 16, 2008 03:30 AM|LINK
The full version of SQL Server doesn't support creating [user instance] 'attached' databases like sql express does (it looks like the connection string is intended for sql express).
create and use the database on your sql server.
then use a connection string something like: "server=localhost;database=TimeTracker;uid=sa;pwd=.." (or use integrated security)
Change in connectionString User Instance = false
<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>
For addtional info
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.
fmorris0
Member
13 Points
10 Posts
Re: Error Message: The user instance login flag is not supported on this version of SQL Server. ...
Sep 22, 2008 03:13 PM|LINK
For SQL Server 2008 Developer Edition, I found that when I got that particular error while trying to run example code I downloaded from the ASP.Net Dynamic Data Futures project, all I had to do was find all occurrences of the following:
DataSource=.\sqlexpress;User Instance=True;
and change them to the following:
DataSource=.; <-- notice I simply removed User Instance = rather than set it to False
Once I did the above, everything worked fine for me. My environment:
Hope this helps anybody dealing with sample code pulled down from the internet that don't want to install SQL Server 2008 Express in addition to Sql Server 2008 Developer Edition.
chetan.sarod...
All-Star
65839 Points
11163 Posts
Re: Error Message: The user instance login flag is not supported on this version of SQL Server. ...
Sep 24, 2008 03:31 AM|LINK
Nice one [:)]
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.