Example #1
0
        public eTrainingOnlineEntities getTrainingOnlineCenterInfo()
        {
            string           providerName = "System.Data.SqlClient";
            ConnectionEntity objEntity    = getConnEntityOnlineInfo();

            SqlConnectionStringBuilder sqlBuilder = new SqlConnectionStringBuilder();

            sqlBuilder.DataSource               = objEntity.serverName;
            sqlBuilder.InitialCatalog           = objEntity.databaseName;
            sqlBuilder.UserID                   = objEntity.userName;
            sqlBuilder.Password                 = objEntity.password;
            sqlBuilder.MultipleActiveResultSets = true;

            string providerString = sqlBuilder.ToString();

            EntityConnectionStringBuilder objEcsb = new EntityConnectionStringBuilder();

            objEcsb.Provider = providerName;
            objEcsb.ProviderConnectionString = providerString;
            //objEcsb.Metadata = @"res://*/eCenterTrainning.csdl|res://*/eCenterTrainningOffline.ssdl|res://*/eCenterTrainningOffline.msl";
            objEcsb.Metadata = @"res://*/eTrainingOnlineModel.csdl|res://*/eTrainingOnlineModel.ssdl|res://*/eTrainingOnlineModel.msl";
            EntityConnection objConnection = new EntityConnection(objEcsb.ToString());

            //TrainingCenterOfflineEntities objTraining = new TrainingCenterOfflineEntities(objConnection.ToString());
            eTrainingOnlineEntities objTraining = new eTrainingOnlineEntities(objEcsb.ToString());

            return(objTraining);
        }
Example #2
0
        //public TrainingCenterEntities getTrainingCenter()
        //{
        //    Common objCommon = new Common();
        //    TrainingCenterEntities objTraining = objCommon.getTrainingCenterInfo();
        //    return objTraining;
        //}
        public eTrainingOnlineEntities getTrainingCenterOn()
        {
            Common objCommon = new Common();
            eTrainingOnlineEntities objTraining = objCommon.getTrainingOnlineCenterInfo();

            return(objTraining);
        }