第100篇博文纪念 | C# 根据数据库表结构生成DOC数据库文档(3)-阿里云开发者社区

开发者社区> 开发与运维> 正文

第100篇博文纪念 | C# 根据数据库表结构生成DOC数据库文档(3)

简介:

<td width="132" valign="top" style='width: 98.65pt; border-top: none; border-left: none;
                        border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt;
                        padding: 0cm 
5.4pt 0cm 5.4pt; height: 15.6pt'>
                        <class="MsoNormal" align="center" style='text-align: center'>
                            
<span lang="EN-US">&nbsp;</span></p>
                    
</td>
                
</tr>
                
<tr style='height: 15.6pt'>
                    
<td width="85" valign="top" style='width: 64.0pt; border: solid windowtext 1.0pt;
                        border-top: none; padding: 0cm 5.4pt 0cm 5.4pt; height: 15.6pt'>
                        <class="MsoNormal" align="center" style='text-align: center'>
                            
<span lang="EN-US">&nbsp;</span></p>
                    
</td>
                    
<td width="131" valign="top" style='width: 98.6pt; border-top: none; border-left: none;
                        border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt;
                        padding: 0cm 
5.4pt 0cm 5.4pt; height: 15.6pt'>
                        <class="MsoNormal" align="center" style='text-align: center'>
                            
<span lang="EN-US">&nbsp;</span></p>
                    
</td>
                    
<td width="132" valign="top" style='width: 98.65pt; border-top: none; border-left: none;
                        border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt;
                        padding: 0cm 
5.4pt 0cm 5.4pt; height: 15.6pt'>
                        <class="MsoNormal" align="center" style='text-align: center'>
                            
<span lang="EN-US">&nbsp;</span></p>
                    
</td>
                    
<td width="132" valign="top" style='width: 98.65pt; border-top: none; border-left: none;
                        border-bottom: solid windowtext 1.0pt; border-right: solid windowtext 1.0pt;
                        padding: 0cm 
5.4pt 0cm 5.4pt; height: 15.6pt'>
                        <class="MsoNormal" align="center" style='text-align: center'>
                            
<span lang="EN-US">&nbsp;</span></p>
                    
</td>
                
</tr>
            
</table>
        
</div>
        
        
<asp:Repeater ID="rptData" runat="server">
            
<HeaderTemplate>
            
</HeaderTemplate>
            
<ItemTemplate>
                
<class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>
                
<class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>
        
                
<class="MsoNormal">
                    
<b><span style='font-size: 12.0pt; font-family: 宋体'></span></b><b><span lang="EN-US"
                        style
='font-size: 12.0pt'>&nbsp; </span></b><b><span style='font-size: 12.0pt; font-family: 宋体'>
                            名:
</span></b><b><span lang="EN-US" style='font-size: 12.0pt'><%#Container.DataItem%></span></b></p>
                
<class="MsoNormal">
                    
<b><span style='font-size: 12.0pt; font-family: 宋体; background: yellow'>表说明:</span></b></p>
        
<table class="MsoTableGrid" border="1" cellspacing="0" cellpadding="0" style='border-collapse: collapse;
            border: none'>
            <tr>
                
<td width="130" valign="top" style='width: 97.7pt; border: solid windowtext 1.0pt;
                    background: #E0E0E0; padding: 0cm 5.4pt 0cm 5.4pt'>
                    <class="MsoNormal" align="center" style='text-align: center'>
                        
<span style='font-family: 宋体'>字段名</span></p>
                
</td>
                
<td width="81" valign="top" style='width: 60.95pt; border: solid windowtext 1.0pt;
                    border-left: none; background: #E0E0E0; padding: 0cm 5.4pt 0cm 5.4pt'>
                    <class="MsoNormal" align="center" style='text-align: center'>
                        
<span style='font-family: 宋体'>数据类型</span></p>
                
</td>
                
<td width="50" valign="top" style='width: 37.3pt; border: solid windowtext 1.0pt;
                    border-left: none; background: #E0E0E0; padding: 0cm 5.4pt 0cm 5.4pt'>
                    <class="MsoNormal" align="center" style='text-align: center'>
                        
<span style='font-family: 宋体'>长度</span></p>
                
</td>
                
<td width="67" valign="top" style='width: 49.95pt; border: solid windowtext 1.0pt;
                    border-left: none; background: #E0E0E0; padding: 0cm 5.4pt 0cm 5.4pt'>
                    <class="MsoNormal" align="center" style='text-align: center'>
                        
<span style='font-family: 宋体'>允许空</span></p>
                
</td>
                
<td width="67" valign="top" style='width: 49.95pt; border: solid windowtext 1.0pt;
                    border-left: none; background: #E0E0E0; padding: 0cm 5.4pt 0cm 5.4pt'>
                    <class="MsoNormal" align="center" style='text-align: center'>
                        
<span style='font-family: 宋体'>默认值</span></p>
                
</td>
                
<td width="88" valign="top" style='width: 65.85pt; border: solid windowtext 1.0pt;
                    border-left: none; background: #E0E0E0; padding: 0cm 5.4pt 0cm 5.4pt'>
                    <class="MsoNormal" align="center" style='text-align: center'>
                        
<span style='font-family: 宋体'>其他</span></p>
                
</td>
                
<td width="86" valign="top" style='width: 64.4pt; border: solid windowtext 1.0pt;
                    border-left: none; background: #E0E0E0; padding: 0cm 5.4pt 0cm 5.4pt'>
                    <class="MsoNormal" align="center" style='text-align: center'>
                        
<span style='font-family: 宋体'>字段说明</span></p>
                
</td>
            
</tr>
            
<%# ColumnInfo(Container.DataItem.ToString()) %>
            
</table>
            
</ItemTemplate>
            
<FooterTemplate>
            
</FooterTemplate>
        
</asp:Repeater>
           
        
<class="MsoNormal">
            
<span lang="EN-US">&nbsp;</span></p>
    
</div>
</body>
</html>      代码说明:
如果大家觉得截图上就是你要的文档格式,这里不用修改直接运行就行了,要是有自己的格式的话需要制作模版,参照文章2,对应修改就行。
2.4  Default.aspx.cs
 

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Text;

public partial class _Default : System.Web.UI.Page

{
 


本文转自over140 51CTO博客,原文链接:http://blog.51cto.com/over140/584169,如需转载请自行联系原作者

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

分享:
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

其他文章