回覆列表
  • 1 # 使用者834195712159

    //Access

    using System.Data;

    using System.Data.OleDb;

    connString ="Provider =Microsoft.Jet.OleDb.4.0;Data Source=" + System.Web.HttpContext.Current.Server.MapPath("~/App_Data/MyDataBase.mdb");

    //SQL server

    using System.Data;

    using System.Data.SqlClient;

    //SQL2005

    connString="Data Source=zhou\\sql2005;Initial Catalog=AspNetStudy;Persist Security Info=True;User ID=sa;Password=123456");

    //SQL2008

    connString = @"server=LENOVO-AA\MYDATABASE;database=Database;Trusted_Connection=True";

    //MySQL

    using MySQLDriverCS;

    using System.Net;

    using System.Text;

    using CoreLab.MySql;

    using System.Data.Odbc;

    using MySql.Data.MySqlClient;

    MySQLConnection DBConn = new MySQLConnection(new MySQLConnectionString("localhost","mysql","root","",3306).AsString);

    connString = "User Id=root;Host=localhost;Database=qing;password=qing";

    //SyBase

    Provider=Sybase.ASEOLEDBProvider.2;Initial Catalog=資料庫名;User ID=使用者名稱;Data Source=資料來源;Extended Properties="";Server Name=ip地址;Network Protocol=Winsock;Server Port Address=5000;

    //Oracle

    using System.Data;

    using System.Data.OracleClient;

    connString="Data Source=sky;user=system;password=manager;";

    //IBM DB2

    connStri = "Driver={IBM DB2 ODBC DRIVER};Database=sample;hostname=192.168.1.46;port=50000;protocol=TCPIP; uid=admin; pwd=admin";

  • 中秋節和大豐收的關聯?
  • 是長蟲子了嗎?我把壞了的葉子剪掉,新長出來還是這樣,小苗買回來有一個月了?