コード例 #1
0
        //
        // Initialize()
        //
        // Perform the minimum requirement of logging onto the c-tree Server
        //

        static void Initialize()
        {
            Console.WriteLine("INIT");

            try
            {
                // initialize connection object
                conn = new CtreeSqlConnection();
                conn.ConnectionString = "UID=ADMIN;PWD=ADMIN;Database=CtreeSql;Server=localhost;Service=6597;";

                // initialize command object
                cmd             = new CtreeSqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.Connection  = conn;

                // connect to server
                Console.WriteLine("\tLogon to server...");
                conn.Open();
            }
            catch (CtreeSqlException e)
            {
                Handle_Exception(e);
            }
            catch (Exception e)
            {
                Handle_Exception(e);
            }
        }