1

How can create connection string for production mode using c# and WPF Application. Now I used this connection string, and Windows Authentication in developer mode. And is working good.

<connectionStrings>
<add name="SensorSystem" connectionString="Data Source=DEVELOPMENT\SQLEXPRESS;Initial Catalog=SensorSystem;Integrated Security=True"
  providerName="System.Data.SqlClient" />

For testing my application is working in the computer very well. But when is finish and database add in the server and application install in another computer is need SQL Authentication for better security and different connection string (I think).

4
  • 1
    The syntax of SQL Server connection strings is very well documented. Did you try googling for this? PS. SQL Authentication results in worse security as the username/password have to be stored somewhere. You also don't have control over who uses these credentials and how. Changing passwords periodically is also a big pain, first because you don't know who uses the account, second because you have to change each individual application setting Commented Oct 5, 2015 at 7:49
  • 1
    You don't need SQL Authentication to connect to a remote computer. Windows Authentication will work just as well, as long as the user running the application has permission to connect to the database. In a Windows Domain you can add each individual user, or put all users in a Group and add the group to the database. Commented Oct 5, 2015 at 7:58
  • 1
    One solution is to use the SqlConnectionStringBuilder instead of handcrafting it. Commented Oct 5, 2015 at 8:01
  • I try googling for this. And find SQL Authentication is with username and password. Now when I open SQL management studio for windows authentication is not need username and password. And for security I think is good to use SQL Authentication, because is want username and password. Commented Oct 5, 2015 at 8:14

1 Answer 1

2

checkout https://www.connectionstrings.com/sql-server/ for all your connection string needs.

you need to remove integrated security = True and add

user id=mylogon;password=mypassword;

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.