Client side application help requested - sql-server

I am testing an application. In tableadapter configuration wizard, On server side:
While choosing data source, I chose Microsoft SQL Server Database File.
This gave the connection string as:
Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database1.mdf;Integrated Security=True;User Instance=True
Is this correct?
Any way this works in my desired way.
Then in SQL Server Mgmt Express, I attached the database to the instance of my SQL Server Express (to MyhomeServer\SQLExpress"
Now I want to use the same application on Client side (off course databse is stored in Data Directory of my application in Server Side) Now in tableadapter wizard, I choose Microsoft SQL Server Express. Is that correct?
I have done all configurations for remote connection etc. and also done the firewall settings. When I run this test on client side, it returns error:
Cannot open database "Database1.mdf" requested by the login. The login failed. Login failed for user 'MYHOMESERVER\Kh. Furqn'.
Why does it go to Kh. Furqan while I am giving it SQLExpress, where the DB is attached. My server is MyHomeServer\SQLExpress and connection is MyHomeServer\Kh. Furqan (Authentication is Windows Authentication, and no password for it)

Since you chose integrated security the program will try to log onto SQL Server with the current logged on user's credentials - 'MYHOMESERVER\Kh. Furqn'. So the first place I would check is make sure that you can log onto Sql Server Mgmt Studio (SSMS) Express with the windows logon option and logged into the server as Kh. Furqn. Let me know if that works.
Wade

Related

Failed to retrieve data (SQL Server Authentication)

I am trying to connect to a database created in the SQL Server 2016 express edition, through Data Source Configuration Wizard in VS2017 Express edition, with SQL Server Authentication.
I created the user in SQL Server, and when I test the connection works perfectly, but vs displays the error. Also in Server properties, I set up SQL and Windows authentication.
I finally found a solution. I checked the checkbox remember password while creating connection string...and now can retrieve data for that user. In connection string is added persisted security=true. Still don't know why this need to be checked, because I follow example without persisted security, and there it worked, but on my PC didn't.

Default SQL Authentication Details for SQL EXPRESS 2016

I'm attempting to remotely connect to my SQL Express 2016 server through MS SQL on my local machine however am having extreme difficulties with the authentication.. Well I assume it is an authentication issue as when I attempt connect to connect to it I receive the error message:
The remote computer refused the network connection.
When connecting through the sqlcmd I am using Windows authentication and have no issue, however to connect to it remotely I need to use SQL authentication and have no memory of creating an account so am wondering if there's a default login and password?
I believe this is the issue however it is quite likely i'm doing something stupid so any assistance would be appreciated!
You can create an account that can be used to connect to that SQLExpress instance by using SQL Server Management Studio. Expand the database you wish to create a login for in the Object Explorer. Under the Security folder, you can create a new login by right clicking the Logins folder.
Also make sure that your machine has its firewall configured to allow remote connections, the server has remote connections enabled, and that you are allowing logins for Windows Auth and SQL Server Auth.
You can allow remote connections for a server by opening the SQL Server Configuration Manager. Under the SQL Server Network Confiuration Node, Select Protocols for MYSERVERNAME. Ensure that TCP/IP is enabled.
Here's a guide on setting up the firewall: https://technet.microsoft.com/en-us/library/ms175043(v=sql.110).aspx
You can enable SQL Server Authentication by right clicking your server name in the object explorer in SQL Server Management Studio and going to the Security tab. look for the "Server Authentication" option.

How to deploy ETL package to a remote SQL Server with SQL authentication?

I'm new to ETL so I have developed a simple ETL package, and now I'm going to deploy it to a remote server.
I connect to server using SQL Server authentication, so I go to solution explorer and open deployment wizard, in there in destination tab entered my server ip and then it shows me a error message saying
Login failed for user 'MYDOMAIN\MYUSERNAME'. (.Net SqlClient Data Provider)
As I said earlier I want to use SQL Server authentication to connect to my server, where can I change this settings in SSIS ?
Take a look at the link below. I think it should solve your problem.
On the Specify Target SQL Server page, specify the instance of SQL Server to install the packages to and select an authentication mode. If you select SQL Server Authentication, you must provide a user name and a password.
https://technet.microsoft.com/en-us/library/ms141693(v=sql.110).aspx

Login Failed on SQL Server 2014

I'm having issues connecting to a SQL Server 2014 database using Management Studio with SQL Authentication. This server was just created by my IT department. I restored a database, I added the login with a password, I made sure the server properties had both SQL Authentication and Windows Authentication checked. I made sure the user at the database level is mapped to the login. But when I try to connect using Management Studio I get the following error. However, it works if I use my Windows Authentication account.
Actually, I kept getting the normal 'Login Failed' message. But this morning I got the above error which is probably more helpful. When I kept trying again, I kept getting the normal Login Failed message.
Have you seen this Microsoft TechNet post about the message you received? It looks like your admin may need to adjust the SQL Server configuration.
Specifically, it looks like you might need to try one of:
Connect using TCP/IP, or use the SQL Server Configuration Manager to
enable remote connections using named pipes.
or...
Using SQL Server Configuration Manager on the client computer, move
TCP before named pipes in the protocol order list.

Why does SQL Server 2008 Express Management Studio change the password of a new login automatically?

I created a new login using Express Management Studio and SQL Server authentication. On create, the password changes to some long format automatically and I am not able to connect using the newly created user with the password I have set.
What do I have to do to let it use the same password that I set and not tamper with it ?
I think Frosco's comment is spot on. Sql Server is not changing the password that you entered, but SQL Server Management Studio (SSMS) is visually modifying the password and confirm password entry boxes to make it appear that the password is longer than what it is.
Have you tried creating the new SQL account, exiting SSMS and reconnecting to the SQL Server instance through SSMS using the newly created SQL Account & password? If this works then you know that you created the account properly and that the password is in fact correct.
As Frosco also said, if you are unable to connect to the SQL Server database remotely it most likely is due to the fact that SQL Server Express is not configured out of the box to accept remote connections.
This KB Article describes the steps you would take to enable remote connections. It is written towards SQL Server 2005, but I believe the same basic steps apply to SQL Server 2008.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277

Resources