如何在vs2012中添加sql localdb的密码? [英] How to add a password of sql localdb in vs2012 ?

查看:329
本文介绍了如何在vs2012中添加sql localdb的密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序(使用vs2012的winform)使用sql localdb v11数据库我需要如何为数据库添加密码?

这是我的连接字符串:



I have an application (winform with vs2012) using sql localdb v11 database i need how to add a password to the database ?
this is my connection string :

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <configSections>
    </configSections>
    <connectionStrings>
     
        <add name="Gestion_De_Vente.Properties.Settings.Gestion_De_VenteConnectionString1"
            connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Gestion_De_Vente.mdf;Integrated Security=True;Connect Timeout=30;Encrypt=False"
            providerName="System.Data.SqlClient" />
    </connectionStrings>
</configuration>

推荐答案

您的连接字符串指定Integrated Security = true,因此密码对您的连接没有任何意义。它使用您登录Windows时获得的安全令牌。
Your connection string is specifying Integrated Security = true so a password doesn't mean anything to your connection. It's using the security token you got when you logged into Windows.


这篇关于如何在vs2012中添加sql localdb的密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆