C#数据库连接字符串

C#--连接Access
String conn="Data Source='fdc.mdb';Jet OLEDB:database password=123; Provider='Microsoft.Jet.OLEDB.4.0';User ID=Admin";

java--连接Access
String strurl="jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ=student.mdb";
  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn=DriverManager.getConnection(strurl) ;
      Statement stmt=conn.createStatement();
      ResultSet rs=stmt.executeQuery("select * from mcp_swty_player");

C#--连接Excel
String conn = "Provider=Microsoft.Jet.OleDb.4.0; Data Source=AllInserInfo.xls; Extended Properties=Excel 8.0;";

C#--连接SQL server
String conn = "Data Source=(local);Initial Catalog=BarefootIndex0425;User Id=sa;Password=sa;Connect Timeout=180;Enlist=true;Pooling=true;Max Pool Size = 300;Min Pool Size = 5;Connection Lifetime=200;packet size=4096";

你可能感兴趣的:(数据库连接)