Exemplo n.º 1
0
        public static IDbConnection OpenReadOnlyDbConnection(this string dbConnectionStringOrFilePath)
        {
            try
            {
                var options = new Dictionary <string, string> {
                    { "Read Only", "True" }
                };

                var sqlConn = DialectProvider.CreateConnection(dbConnectionStringOrFilePath, options);
                sqlConn.Open();
                return(sqlConn);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Exemplo n.º 2
0
 public static IDbConnection ToDbConnection(this string dbConnectionStringOrFilePath)
 {
     return(DialectProvider.CreateConnection(dbConnectionStringOrFilePath, null));
 }