1. SQL.NET 数据提供程序
<%@ Import Namespace=System.Data"" %>
<%@ Import Namespace=System.Data.SqlClient"" %>
sqlcon = new SqlConnection("Server=localhost;database=pubs;uid=sa;pwd=admin");
2. OLE DB.NET 数据提供程序
<%@ Import Namespace=System.Data"" %>
<%@ Import Namespace=System.Data.OleDb"" %>
adocon= new OleDbConnection("Provider=SqlOleDb; DataSource=SQLDB; Initial Catalog=pubs; User ID=sa; Pwd=admin");
Initial Catalog :是数据库
<%@ Import Namespace=System.Data"" %>
<%@ Import Namespace=System.Data.SqlClient"" %>
sqlcon = new SqlConnection("Server=localhost;database=pubs;uid=sa;pwd=admin");
2. OLE DB.NET 数据提供程序
<%@ Import Namespace=System.Data"" %>
<%@ Import Namespace=System.Data.OleDb"" %>
adocon= new OleDbConnection("Provider=SqlOleDb; DataSource=SQLDB; Initial Catalog=pubs; User ID=sa; Pwd=admin");
Initial Catalog :是数据库