通过Windows身份验证来连接:
sqlconnection new sqlconnection.connectionstring = "Persist Security Info=False;Integrated Security=SSPI;database=northwind;server=mySQLServer"
通过SQL 中的 SA 用户验证来连接:
sqlconnection new sqlconnection.connectionstring="Persist Security Info=False;UId=sa;Pwd=xxx;database=northwind;server=mySQLServer"
通过 OLEDB 来连接:
oledbconnection.connectionstring = "Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=Northwind;User id=sa;password=xxx"
本文介绍了如何使用不同的身份验证方式及连接技术(如Windows身份验证、SQL Server中的SA用户验证和OLEDB)来配置SQL连接字符串。
747

被折叠的 条评论
为什么被折叠?



