当前位置:编程学习 > C#/ASP.NET >>

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


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");

 

补充:asp.net教程,.Net开发
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,