<% @ Codetemplate Language = "C #" targetlanguage = "C #" %>
Custom two attributes
<% @ Property name = "spacename" type = "string" default = "mynamespace" Optional = "false" Category = "input" %>
<% @ Property name = "classname" type = "string" default = "myclass" Optional = "false" Category = "input" %>
Set and namespace used for Database Import
<% @ Property name = "sourcetable" type = "tableschema" %>
<% @ Assembly name = "schemaexplorer" %>
<% @ Import namespace = "schemaexplorer" %>
Call the method in script
<% Printheander (); %>
Using system;
Using system. collections;
Namespace <% = spacename %> {
Public class <% = sourcetable. name %> {
Public <% = sourcetable. name %> (){
}
Obtain database data cyclically
<% Foreach (columnschema Col in sourcetable. columns) {%>
Public <% = col. datatype %> <% = col. name %> {Get; set ;}
<% }%>
}
}
<SCRIPT runat = "template">
Public void printheander (){
Response. writeline ("// ...... code by ACCP:" + datetime. Now );
}
</SCRIPT>
Copy the above Code.