CodeSmith的OracleProviders

网上发现一个CodeSmith的OracleProviders,希望对大家有帮助

献上Oracle导出数据的模板:

<%@ CodeTemplate Language="C#" TargetLanguage="PL-SQL" Description="??Oracle????????" %>
<%@ Assembly Name="SchemaExplorer" %>
<%@ Import Namespace="SchemaExplorer" %>
<%@ Property Name="SourceTable" Type="SchemaExplorer.TableSchema" Category="Context" Description="" %>
Created 
<%=DateTime.Now %>
<%for(int intRow=0;intRow<SourceTableData.Rows.Count;intRow++)%>
insert into 
<%=GetTableOwner() %><%=SourceTable.Name %>(<%=AllColumns %>)
values (
<%=AllDate(intRow) %>);
<%}
%>
<script runat="template">
private DataTable _sourceTableData;
private string _allColumns;
private string _allData;

SourceTableData

AllColumns

AllData

FormatData

public string GetTableOwner()
{
    
return GetTableOwner(true);
}


public string GetTableOwner(bool includeDot)
{
    
if (SourceTable.Owner.Length > 0)
    
{
        
return  SourceTable.Owner + ".";
    }

    
else
    
{
        
return "";
    }

}


</script>

Copy Provider DLL 文件到 CodeSmith的安装路径(D:\Program Files\CodeSmith\v4.0\SchemaProviders)
就可以用CodeSmith连接Oracle 数据库。
文件下载

原文地址:https://www.cnblogs.com/mmmhhhlll/p/824635.html