asp.net sqlserver,oledb,oracle连接数据库的字符串(c#)

作者:袖梨 2022-06-25


1,sqlserver

sqlconnetion coon=new sqlconnection("data sourse=localhost;inregrated secyrity=sspi;initial catalog=student(数据库教程名称);user id=sa;ps教程w=12345;(没有密码就不写这个)“);

2,oledb数据源

oledbconnection coon=new oledbconnection("provider=sqloledb;data source =localhodt;integrated security=sspi;initial catalog=student");

3,odbc

odbcconnection coon=new odbcconnection("driver={sql server}; server=(local);trusted_connection=yes;database=student");

4,连接oracle数据库

oracleconnection coon=new oracleconnection("data source=localhost;integrated secrity=yes");

 

相关文章

精彩推荐