ConnectSqlServer() 공개 메소드

public ConnectSqlServer ( string server ) : void
server string
리턴 void
예제 #1
0
 /// <summary>
 /// Connect to a SqlServer database.
 /// This must be called before any SQL methods.
 /// The SqlServer service must be running and database with credentials already created, if in doubt use SQLite.
 /// </summary>
 /// <param name="server">The SqlServer server (e.g. "(local)\SQLEXPRESS").</param>
 /// <param name="database">The SqlServer database name.</param>
 /// <returns>A label to identify the database.</returns>
 public static Primitive ConnectSqlServer(Primitive server, Primitive database)
 {
     try
     {
         ExtractDll();
         DataBase dataBase = GetDataBase(database, false);
         if (null == dataBase)
         {
             dataBase = new DataBase(database, NextID());
             dataBase.ConnectSqlServer(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 a SqlServer database.
 /// This must be called before any SQL methods.
 /// The SqlServer service must be running and database with credentials already created, if in doubt use SQLite.
 /// </summary>
 /// <param name="server">The SqlServer server (e.g. "(local)\SQLEXPRESS").</param>
 /// <param name="database">The SqlServer database name.</param>
 /// <returns>A label to identify the database.</returns>
 public static Primitive ConnectSqlServer(Primitive server, Primitive database)
 {
     try
     {
         ExtractDll();
         DataBase dataBase = GetDataBase(database, false);
         if (null == dataBase)
         {
             dataBase = new DataBase(database, NextID());
             dataBase.ConnectSqlServer(server);
         }
         dataBases.Add(dataBase);
         return dataBase.name;
     }
     catch (Exception ex)
     {
         Utilities.OnError(Utilities.GetCurrentMethod(), ex);
     }
     return "";
 }