惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
腾讯CDC
J
Java Code Geeks
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
博客园 - Franky
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
云风的 BLOG
云风的 BLOG
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
雷峰网
雷峰网
B
Blog RSS Feed
博客园_首页
量子位
F
Fortinet All Blogs
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Check Point Blog

博客园 - csu02

erp asp+com 删除表的一列 更改列名 分页 千万数量级分页存储过程 XML的五种用途~ 表的列数 列名 得到一个省份,城市数据库 window.open()的所有参数列表 存儲過程解密SQL 分页控件 返回存儲過程的多個輸出字段 SqlCommand 与 SqlDataAdapter 产生一个int数组,长度为100,并向其中随机插入1-100 学到的程序结构 几个系统 利用IFRAME 让每个页面都继承菜单控 不是用户自定义控件来实现的 C#事件机制学习 完成单元测试
dataGrid使用 绑定 定向到Url
csu02 · 2006-07-12 · via 博客园 - csu02

1   数据访问层获得数据表

public DataSet GetBraData()

         {    SqlCommand command = new SqlCommand(); 
              command.CommandText = "GetBraInf";
              command.Connection = con;
              command.CommandType = CommandType.StoredProcedure;
              commandAdp.SelectCommand = command;
              DataSet data = new DataSet();
              commandAdp.Fill(data);
              return data;
         }
2   业务逻辑层对数据访问层访问

public DataTable GetBraTB()  
         {
              DataTable table ;          
              MrBranch BraAccess = new MrBranch();//实例化数据访问层的类
              {
                  table = BraAccess.GetBraData().Tables[0];//调用该类的方法
              }
             return table;
         }
3   WEB层绑定数据表
         private void Page_Load(object sender, System.EventArgs e)
         {
              if(!Page.IsPostBack)
              {
                   DataBind();
              }    
         }
         public DataTable BraTB
         {
              get
              {
                   return (new Branch()).GetBraTB();
              }
         }
4     HTML中将其绑定到数据源表    DataSource= "<%# BraTB >"      DataKeyField="branchid"
通过字段值重定向到 新的页面
dataGrid添加一超级连接列,设定URL,   和URL格式字符串 如:EmpArchive.aspx?ArcID={0}