コード例 #1
0
        public ClsDBAccessor(L1HarvestList series, ClsSummaryDB summDB)
        {
            this.summaryDB = summDB;
            if (series.DBInitialCatalog != null && series.DBInitialCatalog != string.Empty)
            {
                SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
                builder.DataSource          = series.DBDataSource;     // drought.usu.edu
                builder.InitialCatalog      = series.DBInitialCatalog; // Summary
                builder.PersistSecurityInfo = true;
                builder.UserID   = series.DBUsername;
                builder.Password = series.DBPassword;
                builder.MultipleActiveResultSets = true;
                //// builder.IntegratedSecurity = true;
                string providerString = builder.ToString();

                EntityConnectionStringBuilder tooConnection = new EntityConnectionStringBuilder();
                tooConnection.Metadata = "res://*/SummaryModel.csdl|res://*/SummaryModel.ssdl|res://*/SummaryModel.msl";//"res://*/ODMModel.csdl|res://*/ODMModel.ssdl|res://*/ODMModel.msl";//"res://*/SummaryModel.csdl|res://*/SummaryModel.ssdl|res://*/SummaryModel.msl";
                tooConnection.Provider = "System.Data.SqlClient";
                tooConnection.ProviderConnectionString = providerString;
                this.tooDB = new ClsTooDB(tooConnection.ConnectionString);
            }
            else
            {
                this.tooDB = new ClsTooDB();
            }
        }
コード例 #2
0
 public ClsDBAccessor()
 {
     this.summaryDB = new ClsSummaryDB();
     this.fromDB    = new ClsFromDB();
     this.tooDB     = new ClsTooDB();
 }