<%@ CodeTemplate Language="C#" Inherits="CodeSmith.BaseTemplates.SqlCodeTemplate" TargetLanguage="T-SQL" Description="Generates SELECT/INSERT/UPDATE/DELETE stored procedure based on a database schema." %>
CodeSmith(5)访问数据库
<%@ Property Name="SourceDatabase" Type="SchemaExplorer.DatabaseSchema" Category="Context" Description="Database that the stored procedures should be based on." %>
CodeSmith(5)访问数据库
<%@ Assembly Name="SchemaExplorer" %>
CodeSmith(5)访问数据库
<%@ Assembly Name="CodeSmith.BaseTemplates" %>
CodeSmith(5)访问数据库
<%@ Import Namespace="SchemaExplorer" %>
CodeSmith(5)访问数据库
<%
CodeSmith(5)访问数据库
for (int i = 0; i < SourceDatabase.Tables.Count; i++)
之后声明个属性Type为SchemaExplorer.DatabaseSchema的属性(数据库).
之后根据SourceDatabase.Tables:即得到该数据库的所有的表的集合,
SourceDatabase.Tables.Count:得到数据库表的数量
SourceDatabase.Tables[i]:得到第i个表
SourceDatabase.Tables[i].Name:得到第i个表的表名

相关文章:

  • 2021-09-19
  • 2021-11-18
  • 2021-09-05
  • 2021-10-09
  • 2021-12-10
  • 2021-12-10
  • 2021-11-17
  • 2021-11-17
猜你喜欢
  • 2022-12-23
  • 2022-01-25
  • 2021-12-28
  • 2021-06-15
  • 2021-08-02
  • 2022-12-23
相关资源
相似解决方案