CodeSmith-Select

<%@ CodeTemplate Language="C#" TargetLanguage="Text" Debug="False" Description="Template description here." %>
<%@ Property Name="SourceTable" Type="SchemaExplorer.TableSchema"  Category="数据库表"  Optional="True" Description="the table name"   %>
<%@ Assembly Name="SchemaExplorer" %>
<%@ Import Namespace="SchemaExplorer" %>

<%  string cols=string.Empty;
    foreach(ColumnSchema col in this.SourceTable.Columns)
    {
        cols+=col.Name+",";
    }
    cols=cols.Remove(cols.Length-1);
    string[] strParamNames=cols.Split(',');
%>
select <%=cols %> from <%=this.SourceTable.Name %>

 

posted @ 2020-07-03 10:39  邪不压正!  阅读(187)  评论(0编辑  收藏  举报