ConnectOleDb() 공개 메소드

public ConnectOleDb ( string provider, string server ) : void
provider string
server string
리턴 void
예제 #1
0
 /// <summary>
 /// Connect to an Access OleDb database.
 /// This must be called before any SQL methods.
 /// The Access OleDb service must be running and database with credentials already created, if in doubt use SQLite.
 /// </summary>
 /// <param name="provider">The OleDb provider (e.g. "SQLOLEDB").</param>
 /// <param name="server">The OleDb server (e.g. "localhost").</param>
 /// <param name="database">The OleDb database name.</param>
 /// <returns>A label to identify the database.</returns>
 public static Primitive ConnectOleDb(Primitive provider, Primitive server, Primitive database)
 {
     try
     {
         ExtractDll();
         DataBase dataBase = GetDataBase(database, false);
         if (null == dataBase)
         {
             dataBase = new DataBase(database, NextID());
             dataBase.ConnectOleDb(provider, server);
         }
         dataBases.Add(dataBase);
         return(dataBase.name);
     }
     catch (Exception ex)
     {
         Utilities.OnError(Utilities.GetCurrentMethod(), ex);
     }
     return("");
 }
예제 #2
0
파일: DataBase.cs 프로젝트: litdev1/LitDev
 /// <summary>
 /// Connect to an Access OleDb database.
 /// This must be called before any SQL methods.
 /// The Access OleDb service must be running and database with credentials already created, if in doubt use SQLite.
 /// </summary>
 /// <param name="provider">The OleDb provider (e.g. "SQLOLEDB").</param>
 /// <param name="server">The OleDb server (e.g. "localhost").</param>
 /// <param name="database">The OleDb database name.</param>
 /// <returns>A label to identify the database.</returns>
 public static Primitive ConnectOleDb(Primitive provider, Primitive server, Primitive database)
 {
     try
     {
         ExtractDll();
         DataBase dataBase = GetDataBase(database, false);
         if (null == dataBase)
         {
             dataBase = new DataBase(database, NextID());
             dataBase.ConnectOleDb(provider, server);
         }
         dataBases.Add(dataBase);
         return dataBase.name;
     }
     catch (Exception ex)
     {
         Utilities.OnError(Utilities.GetCurrentMethod(), ex);
     }
     return "";
 }