I'm using SQL Server 2008 R2 for Window 8
When I built my webpage, sql server suddently stop and show an error :"Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed. "
Try to fix that problem by searching google. As recommended, I have to delete the folder C:\Users\User\AppData\Local\Microsoft\Microsoft SQL Server Data, but there is no folder with that path
Try another way,I run the below code in SQL Query window:
exec sp_configure 'user instances enabled', 1.
Go
Reconfigure
But it has an error: The configuration option 'user instances enabled' does not exist, or it may be an advanced option.
Help!!! Which way is the better one??? And How can I fix this:Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.
You can try this:
Stop all user instance processes of SQL Server running under your local account (open up task manager and look for sqlsrv.exe process and end it)
Delete all files in the %LOCALAPPDATA%\Microsoft\Microsoft SQL Server Data\SQLEXPRESS folder
All be aware that if you are using XP the location will be something like
C:\Documents and Settings\\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS
F5 again
The problem is known issue. SQL Express cannot create a user instance using the set of engine files in your local app data folder, deleting them should allow sql server to recreate them with the correct credentials for you to F5 successfully.
I believe you may not be having SQLExpress installed as directories does not exist. In that case you will need to reinstall the version of SQL Express that was included in the project.
Related
I'm trying to setup a local version of a website that's online and working. The site is built with Umbraco V6, and is using an SQL Server database. My test server is a fresh install of Server Standard 2012 and SQL Server 2012.
My process has been to:
Install the O/S and SQL Server
Setup a test Umbraco site in IIS, installing from scratch into a fresh database
Once 2. is working, download the source code from the live server and install in a new site in IIS
Download a copy of the live SQL Server database and restore it into the server
Add a new user account into SQL Server, granting permissions onto the SQL database i've restored
When I try to access the website through a browser, I get an error. This shows up in IIS as:
Event Code 3005. An unhandled exception has occurred. No connection could be made because the target machine actively refused it
I've disabled the Windows Firewall and have checked I can telnet into the server on port 1433. I know the Web.config is using the right credentials, as I can change it to a different user account and see a different error.
Can anyone point me in the right direction to resolve the error?
You should go through the steps listed over here:
http://blogs.msdn.com/b/sql_protocols/archive/2007/07/19/tcp-provider-no-connection-could-be-made-because-the-target-machine-actively-refused-it.aspx
I suspect that your connection string is pointing to the wrong server instance or that the TCP protocol is not configured correctly.
Tip: You can always copy and paste the settings from your connectionstring into the Connect Object Explorer of SQL Management Studio to verify that they work.
I installed adventure works, and I followed the instructions on this page:
How to: Create Connections to SQL Server Databases
basically nothing appears in the drop down, in step 2.
I cant even attach the database without getting an error, nor drag it to the web form.
It tells me that the database cant be attached cause it is version 705, and the server supports version 655..
Also what is teh difference between attaching the database and connecting to it?
I went to the installation center of 2008, and clicked on show installation info..I got this:
Microsoft SQL Server 2008 Setup Discovery Report
Product Instance Instance ID Feature Language Edition Version Clustered
Sql Server 2008 SQLEXPRESS MSSQL10.SQLEXPRESS Database Engine Services
1033 Express Edition 10.1.2531.0 No Sql Server
2008 SQLEXPRESS MSSQL10.SQLEXPRESS SQL Server Replication 1033 Express
Edition 10.1.2531.0 No
so I guess it is installed on my computer, but I cant access the application
You need the database to exist in an instance of SQL Server (or whatever RDBMS you so choose...but most likely, SQL Server). To do this you can do a few things: namely restore a *.bak database backup file of AdventureWorks, or you can attached the mdf and ldf files (database data and log files) to get your database online.
basically nothing appears in the drop down
Do you have an instance of SQL Server installed on your machine?
Also what is teh difference between attaching the database and connecting to it?
Attaching the database is using mdf and ldf files to get your database online ready for transactions. Connecting to the database is creating a connection between a client application and the aforementioned database. Two very different steps of the data access process.
Attaching to a database is necessary when the database file(s) are in a location other than the default location. You don't really "connect" to a specific database per se. You connect to a sql server instance which contains a list of databases on that instance (or referenced by the instance).
I am trying to deploy my web application created with asp.net in visual studio 2010. I have successfully created .exe and .msi file, install it and run using IIS Manager. However, it needs a database which is why it is returning
System.Data.SqlClient.SqlException: The SELECT permission was denied on the object 'TableName', database 'master', schema 'dbo'.
whenerver I try to run it on browser with localhost.
How do I include my database file in deployment so that when I install my application in another computer, the database will also be created?
It is not at all clear what exactly you mean by database file but if you are referring to an SQLLite or SQL Server CE database file all you have to do is go to properties and change the "Copy to Output Directory" property to "Copy if Newer" (don't forget to do the same with the required class libraries).
If you are referring to SQL Server, Oracle or some other RDBMS database than you can't just copy the file, you'd have to either use DDL to create the database or attach the database file using the SSMS.
EDIT: I did not pay attention to the exception you posted so the second part of my question is relevant. SQL Server database file cannot be just copied to another computer, the target computer must have the SQL Server installed and you must detach the file from your local SQL Server and attach it on the remote SQL Server using the SQL Server Management Studio.
I want to setup a website that uses an SQL Express .mdf file located in the APP_DATA folder. when I create the site as a file-system website, it connects to the database file without issue...
however when I create the same site in IIS and I get to the point where it wants to attach to the SQL Express database, it says it cannot connect.
I'm kind of lost as to how these are different, as I've only ever used the full SQL Server, that is creating a new database and setting connection strings. This sql express site seems to just "pick up" the local database. It appears to be doing this automatically in file-system mode...
can someone provide me with some insight as to how these are different and if a) I can do the same thing when using IIS instead of the file-system and b) how this would be done (I'm thinking permissions?)
thanks!
Check Server Configuration Manager on your SQL Express setting. Make sure remote connections are allowed and also check your firewall settings.
By default remote connections are not allowed in SQL Express.
okay, it turns out that the Application Pool had the "Load User Profile" setting to "False" in IIS. This results in the error:
Failed to generate a user instance of
SQL Server due to failure in
retrieving the user's local
application data path. Please make
sure the user has a local user profile
on the computer. The connection will
be closed. [CLIENT: ]
I don't remember why this happens or what it means, or if changing it is a security risk, but I ALWAYS encounter this problem, and setting it to "True" completely fixed the problem!
can anyone tell me more about what this setting is for and why it keeps getting set to false?
I tried to install Amplifeeder today with the Web Platform Installer.
When I arrived at the database setup I had to fill out some informations like "db admin user/password" and user username/password.
Using SQL Express I do not have any username/password (neither admin or user). How should I be able to install applications with the WPI and SQL Express 2008 ?
Basically I had this error while trying to install in the logs :
DownloadManager Error: 0 : MS Deploy exception: Microsoft.Web.Deployment.DeploymentClientServerException: The database 'AmpliFeederDB' could not be created. ---> System.Data.SqlClient.SqlException: Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection.
I finally achieved this by command line and reg fixes.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQLServer
LoginMode must be 2
restart SQL Server Express service.
Then :
In command line :
sqlcmd -E -S .\SQLEXPRESS (will login with windows authentication mode)
1) ALTER LOGIN sa WITH PASSWORD = '<new_password>'
2) GO
1) ALTER LOGIN sa ENABLE
2) GO
It should do the trick to install the applications after.
As far as I know the only way I could make it work was by using the command line utility 'WebPICmd.exe' located in the application folder.
You do need a strong password because it uses a regular expression to verify.
All seemed OK, I was able to access the DB thru OSQL and also Management Studio, had no problems with logons, had both authentications enabled, TCP/IP and named pipes. yet nothing worked... It seems to be some kind of a bug....
Thry it like his:
WebPICmd.exe /Install /Application:"Joomla"
When you install SQL Server Express for the first time, you would have had option to select authentication mode, where you would select MIXED mode authentication and provide admin authentication details.
Well, the SQL Server Management Studio Express provides a more sustainable solution. See this link, without having to fiddle with registry keys & running commands:
http://www.knowledgesutra.com/forums/topic/61695-resolving-cant-login-to-sqlexpress-using-sa-account/