Vb.Net SQlConnection 字符串之间的区别

Vb.Net The Difference Between SQlConnection Strings

大家好,我有一个简单的问题,关于这些 SQlConnection 字符串之间的区别

1.

Dim Con As New SqlConnection("Server = Z\SQL; Database = Project; id = zzz; pwd = zzz integrated Security = true")
Dim Con As New SqlConnection("Driver = {SQL SERVER}; Server = Z\SQL; Database = Project; id = zzz; pwd = zzz integrated Security = true")
    Dim Con As New SqlConnection("@Server = Z\SQL; Database = Project; id = zzz; pwd = zzz integrated Security = true")

还有哪个是最优化的程序?

先致谢

1 和 2 代码相同,如果您不想通过 Windows 身份验证访问您的 SQL,则将集成安全设置为 False,然后添加 UID(Sql Login Id) & PWD (Password) 到字符串中。

谢谢大家。