资源简介
使用办法:
找到CodeSmith的SchemaProviders目录,替换文件,即可。压缩包中也有.cs文件
如果打开失败重新选择一下驱动就可以了
代码片段和文件信息
// ====================================================================
// Description: MySQL Schema Provider for CodeSmith 5.x
// Author: David Neal -- www.ChristianASP.NET
// Modified By: Blake Niemyjski -- http://windowscoding.com
// ====================================================================
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Text;
using System.Text.Regularexpressions;
namespace SchemaExplorer
{
///
/// MySQL Schema Provider
///
public class MySQLSchemaProvider : IDbSchemaProvider
{
#region Properties
#region IDbSchemaProvider Members
///
/// Gets the name of this schema provider.
///
///
public string Name
{
get { return “MySQLSchemaProvider“; }
}
///
/// Gets the description for this schema provider.
///
///
public string Description
{
get { return “MySQL Schema Provider“; }
}
#endregion
#endregion
#region public string GetDatabaseName(string connectionString)
///
/// Gets the name of the database.
///
/// The connection string used to connect to the target database.
/// The name of the database
public string GetDatabaseName( string connectionString )
{
// Problem is INFORMATION_SCHEMA appears to retrieve information for
// every database instead of just the current database
// So we‘ll need to parse the connection string instead of pulling
// the current database directly
Regex databaseNameRegex = new Regex( @“Database\W*=\W*(?se>[^;]*)“ RegexOptions.IgnoreCase );
Match databaseNameMatch = databaseNameRegex.Match( connectionString );
if ( databaseNameMatch.Success )
{
return databaseNameMatch.Groups[ “database“ ].ToString();
}
return connectionString;
}
#endregion
#region public string GetViewText(string connectionString ViewSchema view)
///
/// Gets the definition for a given view.
///
/// The connection string used to connect to the target database.
///
///
public string GetViewText( string connectionString ViewSchema view )
{
StringBuilder sb = new StringBuilder();
string commandText = string.Format( “SELECT VIEW_DEFINITION FROM INFORMATION_SCHEMA.VIEWS WHERE TABLE_SCHEMA = ‘{0}‘ AN
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 52155 2017-12-07 16:35 MySQLSchemaProvider.cs
文件 36864 2017-12-07 16:35 SchemaExplorer.MySQLSchemaProvider.dll
文件 164 2018-12-25 19:31 使用说明.txt
相关资源
- mysql数据库驱动8.0.12版本
- InsideTSQL2008.sql
- Navicat For MySql 8.0.20 简体中文版(含破
- mysql5.7驱动.rar
- cmake-2.8.11.2.tar.gz
- sqldecryptor_3.0.8.rar
- 速达3000net v8.53 Build20070414_9999用户免狗
-
Stellar Phoenix SQL Databa
se Repair 8.0 破解 - mysql-connector-net-6.8.3
- kettle8.1Hive连接包
- 汽车衡称重管理系统 3.8.3网络版破解
- PLSQL Developer 8.0.0.1483含注册码
- nbu8.0备份恢复图文.docx
- mysql-connector-odbc-8.0.13-win32
- aqt8.25带序列号
- SQLYog8.14中文版本(含注册码)
- MONyog8.5破解版
- PowerBuilder 8.0中文参考手册(带书签高
- SQLAlchemy-1.2.18.tar.gz
- Websphere8.5配置
- 北大青鸟ACCP8.0的超市订单管理系统
- mycat Mysql8.0
-
38.322 5G Radio li
nk Control (RLC) prot - PLSQL_Developer8.0绿色版64位
- SQLPrompt_9.5.12.10845.zip 可支持SMS 18.4
- SQLPrompt10.1.5.14730 支持vs2019+SQL2019+SSM
- 新版 MySQL DBA 高级视频 基于MySQL 5.7
- MONyog-8.6.0-0_X32_X64_RPM
- Navicat8.2MySQL.zip
- Toad for Oracle 8.5.3绿色免激活版
评论
共有 条评论