示例#1
0
        public static bool ConnectDatabase(MaddogDataBase dataBaseType = MaddogDataBase.OrcasTS)
        {
            bool isConnect = false;
            string mdsql = "mdsql3";
            string dataBaseName = "OrcasTS";

            switch (dataBaseType)
            {
                case MaddogDataBase.OrcasTS:
                    break;
                case MaddogDataBase.Whidbey:
                    mdsql = "mdsql2";
                    dataBaseName = "Whidbey";
                    break;
                default:
                    break;
            }
            try
            {
                MadDogObjects.Utilities.Security.AppName = "Reporter XDT";
                MadDogObjects.Utilities.Security.AppOwner = Environment.UserName;

                MadDogObjects.Utilities.Security.SetDB(mdsql, dataBaseName, "MDReadWrite", "Cujo");

                isConnect = true;
            }
            catch (Exception ex)
            {
                string msg = "Unable to connect Maddog database: " + dataBaseType.ToString() + "\n" + ex.Message + "\n" + ex.StackTrace;
            }

            return isConnect;
        }
示例#2
0
        public static bool ConnectDatabase(MaddogDataBase dataBaseType = MaddogDataBase.OrcasTS)
        {
            bool   isConnect    = false;
            string mdsql        = "mdsql3";
            string dataBaseName = "OrcasTS";

            switch (dataBaseType)
            {
            case MaddogDataBase.OrcasTS:
                break;

            case MaddogDataBase.Whidbey:
                mdsql        = "mdsql2";
                dataBaseName = "Whidbey";
                break;

            default:
                break;
            }
            try
            {
                MadDogObjects.Utilities.Security.AppName  = "Reporter XDT";
                MadDogObjects.Utilities.Security.AppOwner = Environment.UserName;

                MadDogObjects.Utilities.Security.SetDB(mdsql, dataBaseName, "MDReadWrite", "Cujo");

                isConnect = true;
            }
            catch (Exception ex)
            {
                string msg = "Unable to connect Maddog database: " + dataBaseType.ToString() + "\n" + ex.Message + "\n" + ex.StackTrace;
            }

            return(isConnect);
        }