ConnectionString() 공개 메소드

public ConnectionString ( ) : string
리턴 string
예제 #1
0
        public string GetConnString(InstallerConfig config, string dbName)
        {
            string connString = string.Empty;

            //if (config.Database.UseSqlCe40)
            //{
            //    connString = SqlCeConnection(config);
            //}
            //else
            //{
            //    // For standard connections.
            //    connString = NamedDbConnection(config, dbName);
            //}

            /* Update by King Wilder
             * Date: November 22, 2011
             * This uses the new ConnectionFactory to generate proper connection strings based
             * on the incoming parameters in the InstallerConfig object.
             */
            ConnectionFactory factory = new ConnectionFactory(config);

            connString = factory.ConnectionString();

            return(connString);
        }
        public string BuildEntityFrameworkConnectionString()
        {
            //string standardConn = GetConnString();
            //string connString = string.Format(@"metadata=res://*/Models.{0}.csdl|res://*/Models.{0}.ssdl|res://*/Models.{0}.msl;provider=System.Data.SqlClient;provider connection string="{1}MultipleActiveResultSets=True;App=EntityFramework"", config.Database.EntityFrameworkEntitiesName, standardConn);

            //return connString;

            ConnectionFactory factory = new ConnectionFactory(config);
            return factory.ConnectionString();
        }
예제 #3
0
        public string BuildEntityFrameworkConnectionString()
        {
            //string standardConn = GetConnString();
            //string connString = string.Format(@"metadata=res://*/Models.{0}.csdl|res://*/Models.{0}.ssdl|res://*/Models.{0}.msl;provider=System.Data.SqlClient;provider connection string="{1}MultipleActiveResultSets=True;App=EntityFramework"", config.Database.EntityFrameworkEntitiesName, standardConn);

            //return connString;

            ConnectionFactory factory = new ConnectionFactory(config);

            return(factory.ConnectionString());
        }
        public string GetConnString(InstallerConfig config, string dbName)
        {
            string connString = string.Empty;

            //if (config.Database.UseSqlCe40)
            //{
            //    connString = SqlCeConnection(config);
            //}
            //else
            //{
            //    // For standard connections.
            //    connString = NamedDbConnection(config, dbName);
            //}

            /* Update by King Wilder
             * Date: November 22, 2011
             * This uses the new ConnectionFactory to generate proper connection strings based
             * on the incoming parameters in the InstallerConfig object.
             */
            ConnectionFactory factory = new ConnectionFactory(config);
            connString = factory.ConnectionString();

            return connString;
        }