.net中两种常用数据配置(待扩展)
1.与access的连接
provider=microsoft.jet.oledb4.0,datasource=c:\\northwind.mdb;
datasource的标准形式为:mydrive:mypath\myfile.mdb;
2.与sqlserver的连接
设置sa账户及密码
connectionString="Data Source=abc;Initial Catalog=def;User ID=sa;Password=123456"
--abc为sql服务器名,def为数据名,sa为账号,123456为密码
initial catalog=northwind;server=YOURSQLSERVER;connect timeout=20;userid=sa;password=123456
userid=uid
password=pwd
initial catalog=database
server=data source
integrated security=trust_connection
如果设置为windows登陆,需使用trust_connection=sspi
没有设置sa账号及密码(集成验证)
connectionString="Data Source=abc;Initial Catalog=def;Integrated Security=SSPI"