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.
Related
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
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.
I built a window application in visual studio 2010. It is working fine at my computer.
if i have a pc that works with windows server 2008 and i install a sql server on it , how to make my application connect to database in the sql server that instaled in the server pc .
my pc connected to the server domain .
thanks
Assuming your application is already configured to use a Sql connection string, you'll just need to configure it for the Sql Server instance you're connecting to.
For example, if your database is called MyDatabase, and your windows server on your domain is called myserver.local, and you've installed Sql Express with the default SQLEXPRESS instance name, you could create your connection string (assuming ADO.NET) something like this:
Integrated Security=true;Initial Catalog=MyDatabase;Data Source=myserver.local\SQLEXPRESS
This configuration would be for Windows Authentication (Integrated Security=true): so your domain user accounts would need to be granted LOGIN rights on the server, and those Logins associated with USERS and ROLES in your database. If you wanted to use Sql Logins instead (generally requires extra configuration when setting up your Sql Server), there are different connection strings settings for specifying username and passwords. There are many options available for the connection strings as documented here: https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring(v=vs.110).aspx. However, with Windows Authentication the only 3 you absolutely need are the ones shown above.
You can test connectivity to your Sql Server from your PC on the network using Sql Server Management Studio, which will enable you to verify the instance name and the authentication is working as expected if you can connect to the database.
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
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