VB.NET 几种连接数据库的方式汇总
VB.NET连接数据库的实现方法有许多种。通过本文介绍的相关内容,大家可以掌握各种方法的运用技巧,帮助我们提高编程效率。
[1].通过 OLE DB 连接 SQL Server
Dim oleDbConnection1 As OleDb.OleDbConnection
Dim strConnect As Sting=”Provider=SQLOLEDB;Persist Security Info=False; Data Source=服务器名;Initial Catalog=数据库名;User ID=sa;Password=;”
oleDbConnection1=New System.Data.OleDb.OleDbConnection(strConnect)
[2].通过 OLE DB 连接 Access
Dim oleDbConnection1 As OleDb.OleDbConnection
Dim strConnect As Sting=”Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:Data Example.mdb”
oleDbConnection1= New System.Data.OleDb.OleDbConnection(strConnect)
[3].通过 OLE DB 连接 Oracle
Dim oleDbConnection1 As OleDb.OleDbConnection
Dim strConnect As Sting=”Provider=MSDAORA;Data Source=服务器名;User ID=用户ID;Password=密码;”
oleDbConnection1= New System.Data.OleDb.OleDbConnection(strConnect)
[4].通过ODBC连接 SQL Server
Dim odbcDbConnetion1 As Microsoft.Data.OdbcConnection
Dim strConnect As Sting=”Driver={SQL Server};Server=服务器名;Uid=sa;pwd=;Database= 数据库名;”
odbcDbConnetion1=New Microsoft.Data.OdbcConnection(strConnect)
[5].通过ODBC连接 Oracle
Dim odbcDbConnetion1 As Microsoft.Data.OdbcConnection
Dim strConnect As Sting=”Driver={Microsoft ODBC for Oracle};Server=服务器名;Uid=sa;pwd=;”
odbcDbConnetion1=New Microsoft.Data.OdbcConnection(strConnect)
坐等大佬D盘更新,祝大佬全家福寿安康
有公众号之类的吗,之前这个网站打不开了
[…] 关于使用Change…
[…] 关于使用Functi…
谢谢提醒,已删 :)