Can applications hosted in IIS Express utilize SQL Server aliases? - sql-server-2008

I have a Web-API project that is configured with a connection string which sets the Data Source to an alias defined in SQL Server Configuration Manager. The server runs fine when launched through Visual Studio 2013, but when launched as a separate process using %PROGRAMFILES%\IIS Express\iisexpress.exe it fails to connect and eventually times out with the error:
System.ComponentModel.Win32Exception (0x80004005): The network path was not found
The process works as expected if the connection string is modified to specify the actual server (e.g. localhost) rather than using the alias.
I discovered this question asked on a RedGate forum which seems to indicate that at least one other person has had this issue as well.

This issue of the alias not getting picked up ended up being a result of the 64-bit version of IIS Express running a process that tries to connect to a 32-bit install of SQL Server 2008. Once I changed the execution path to %PROGRAMFILES(x86)%\IIS Express\iisexpress.exe then it worked correctly.

Related

The client and server cannot communicate, because they do not possess a common algorithm while connecting to mysql database

I have a console application that runs on .Net framework 4.6.2. It's deployed on Windows server 2012 R2. I'm using MySql.Data.MySqlClient,MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.12.0. My server is configured to use only Tls1.2. It was working fine earlier and now its giving me this error
"System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.ComponentModel.Win32Exception: The client and server cannot communicate, because they do not possess a common algorithm"
I checked the DB server (same operating system) and it has tls1.0 , tls1.1 and tls1.2 all enabled. I copied the database from the DB server on to the same production server but still getting this error. It was working fine before so not sure if there is a problem with the code itself but since this is urgent I appreciate any help I can get on this.

Does SSIS Components have to be installed on all involved hosts?

TLDR; I am attempting to connect to a host and hitting "To run a SSIS package outside of SQL Server Data Tools you must install Derived Column of Integration Services or higher". Does SSIS need to be installed on all Hosts for my package to succeed? Secondary question: If so, why would a manual execution from my dev machine work while the deployed/dtexec versions fail?
Apologies if this is a basic question (I am still steeping myself in all things SSIS and trying to learn as quickly as possible). Thanks in advance for any assistance you can provide!
I have a package that runs fine on my development machine (via Visual Studio). However, when I deploy the package out I encounter errors when attempting to connect to a MySQL database on a secondary host machine on the network. Taking a step back, I decided to attempt a manual execution via DTEXEC on my dev machine to attempt troubleshooting...
When executing this package through DTEXEC however, I encounter an error stating:
"To run a SSIS package outside of SQL Server Data Tools you must install Derived Column of Integration Services or higher"
Looking at the log, it looks like the package is able to connect to Host 1 successfully and do some data manipulation (one of the 3 hosts; I know Host 1 and Host 3 have SSIS installed). However, when it attempts connection to Host 2, it fails with the aforementioned error. For the longest time, I thought this was due to the MySQL database I am trying to connect to (using .net Provider\MySQL Data Provider) but given the error above, it is possibly pointing to something else...
After doing a bit of searching I have located the following articles which may be related:
https://dba.stackexchange.com/questions/49786/error-to-run-a-ssis-package-outside-of-sql-server-data-tools-you-must-install
Getting error running SSIS package on non-SSIS Server
I know SSIS isn't installed on Host 2. The package is being executed from Host 1 and this host does have SQL Server and SSIS installed. Host 3 additionally has SQL Server and SSIS installed and I am able to successfully operate/connect on this host as well. The only host presenting a problem is Host 2 which does not have SQL Server nor SSIS installed.
Do all hosts have to have SSIS installed for connections to be made? Additionally, if SSIS does need to installed on Host 2, why would my dev machine succeed while the dtexec/deployed versions fail?
Again, thank you for any assistance you can provide!
The answer to your first question is "Yes", and that fact is the answer to your secondary question.
In short, SSIS packages are NOT self-contained executable files. They are more like .ini files that the SSIS Service reads, interprets, and executes. If the SSIS Service is not running on a host computer, then that computer cannot do anything with an SSIS package (the .dtsx file).
Your dev machine succeeds because it has Visual Studio, or BIDS, which is a developer's version of the SSIS Service engine.

Connect to sql server 2008 using Microsoft Server Management Studio

I have difficulties connecting to my MS SQL Server and I can't find tutorial or answer how to do this, even though I think this should be something pretty standard.
My current setup is this - I have freshly new Installed Visual Studio 2010 and followed Beth Massi's article Step-by-Step: Installing SQL Server Management Studio 2008 Express after Visual Studio 2010 : http://blogs.msdn.com/b/bethmassi/archive/2011/02/18/step-by-step-installing-sql-server-management-studio-2008-express-after-visual-studio-2010.aspx
But I'm not able to connect to a SQL Server. In my Configuration Tools\SQL Server Configuration Manager I see this when I open it :
I set to Enable all TCP\IP and Named Pipes (Just saw that this may be a problem) and in the properties of the SQL Server (SQLEXPRESS) from Services I see this:
I also see in the Log On tab this :
some sort of password (not entered by me) it seems to be something default, but since I'm not sure where the problem is I try to show everything I think may have something to do with solving my problem.
At the end I tried different options to connect to my SQL Server form the Management Studio I ended up with this:
As you see I get an error (included in order to be able to read it). I read the the machine name may be required so my User Account name is Xman and my machine's name is Xman-PC. Eveh though my printscreen image is not from this try I made an attempt to connect to the Server with XMAN-PC\SQLEXPRESS but again - no success.\
Could you point me to a good tutorial on how to connect to a MS SQL Server (I can't believe there's nothing that explains in simple steps what you need to do to connect to a server) or could you tell me how to set-up my configurations so I actually can start to work with databases?
P.S
Forgot to mention in Command Prompyt - sqlcmd command also returns error - Could not open SQL connection.
P.S
Finally I managed to connect using Windows Authentication and (local)\sqlexpress for ServerName. Which at least means that everything is working. But now even more I would like to know how to connect using SQL Server Authentication. It must be something default as it was for Windows Authentication?!
Looks like you've done the hard work - last step will be turning on SQL Server Authentication.
Since you installed with the default values, only Windows Authentication is allowed; you need to set it to SQL Server and Windows Authentication mode. You can do this through Management Studio through the instance Properties -> Security.
See this link for full details: Change Server Authentication Mode.

IIS7 Connection to SQL 2008 not working

Having trouble getting my local IIS7 running C # MVC app to connect to a newly installed Sql 2008. IT was working wiht SQL Express, but we upgraded every machine to full SQL. Now, just my machine, will not connect to SQL 2008.
Followed many websites info, fooled wiht the user account both in IIS7 and SQL2008. Setting permissions to the DB's with db_owner(actually selected every permission) just not connecting.
I noticed the w3wp.exe service is not running. Not sure if that is the issue or if it was even running before.
Messed with the and tried all the sugeestions and tutorials out there that had to do with
Application pools are running, their set to the proper settings
IIs Account NetorkServices
Sql NT AUTHORITY\NETWORK SERVICE
created users for IIS APPPOOL\ASP.NET v4.0
When i check the sql logs there is no sign of it even trying to connect. The only message i get is when i restart IIs. Just says starting and stopping.
Been thru this before when i first tried to connect to SQL express, and was not this hard, and i did not touch anything in IIs when i installed sql 2008. So it should have connected.
Any other suggestions out there?
LLBL DataAccessAdapter should have string property ConnectionStringKeyName which contains app settings key (in web.config), which contains connection string. Visual studio does not use that connection string and you being able to connect to db from VS does not mean that connection string your application uses is valid.
Indirectly you lead me to the solution. lol
Started searching on running IIs and Sql 2008 on the same machine.
Running on a Win7 64bit, IIS7 an sql2008 R2.
Long story short, after hours and hours of fighting with IIS and SQL.
IIS7 --> Application Pools --> Select your pool --> Advanced settings --> General tab --> Enable 32-bit Applications set to true.
How it got to false, or why sqlexpress worked and sql2008 did not, not sure. But this fixed the issue.

Experiencing problems running Sql Server 2008 Express Edition SP1 on Windows 7 (firewall issue?)

I've installed sql2008 express sp1 on my laptop that's running the beta 1 of windows 7. The problem that I'm experiencing is a combination of dynamic ports/firewall/windows 7.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I was first experiencing this problem when I was trying to connect to sql with the management tools, but as soon as I enabled Sql Server Management Tools as a program to go through the firewall it worked out fine. Now the problem is when I launch my web site it gives me that error. I've also positive that sql browser is running and I've enabled tcp/ip and named pipes in the sql express service.
So does anyone have any thoughts as to how to resolve this?
Are you using the same instance name in both SSMS and your web application?
Commonly, people will try to connect based upon the machine name exclusively, for instance "MySQLServer". SQL Server Express installs a named instance by default, whose default name is SQLExpress. If this is the case, try connecting to "MySQLServer\SQLExpress" instead (omitting the quotes, of course).
Go into SQL Server Configuration Manager - under Programs - Microsoft SQL Server 2008 - Configuration Tools - and make sure that under SQL Server Network Configuration - Protocols for SQLExpress, that Named Pipes is enabled (by default it is not).
Yes, I'm aware of both scenarios. I've setup as a named instance and as a default instance as well, and adjusted the connection strings, neither worked.
I've also enabled named pipes and no go. It has everything to do with windows 7 firewall, but couldn't figure it out so I just installed server 2008 standard edition and voila.
I suspect the fact that it uses dynamic ports is another issue with windows 7.