zoukankan      html  css  js  c++  java
  • ComponentArt MethodNeedDataSource etc.

    public void OnNeedDataSource(object sender, EventArgs oArgs)
      
    {
        buildGrid();
      }


     private void buildGrid()
      
    {
        
    string conStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
        conStr 
    += Server.MapPath("~/common/db/demo.mdb"); 
        System.Data.OleDb.OleDbConnection dbCon 
    = new System.Data.OleDb.OleDbConnection(conStr); 
        dbCon.Open(); 

        
    string sql = "SELECT * FROM Posts ORDER BY LastPostDate DESC"
        System.Data.OleDb.OleDbDataAdapter dbAdapter 
    = new System.Data.OleDb.OleDbDataAdapter(sql, dbCon); 
        DataSet ds 
    = new DataSet(); 
        dbAdapter.Fill(ds); 
        ds.Tables[
    0].TableName = "Inbox"

        Grid1.DataSource 
    = ds;
      }


    1private void InitializeComponent()
    2    {    
    3        this.Load += new System.EventHandler(this.Page_Load);      
    4    Grid1.NeedRebind += new ComponentArt.Web.UI.Grid.NeedRebindEventHandler(OnNeedRebind);
    5    Grid1.NeedDataSource += new ComponentArt.Web.UI.Grid.NeedDataSourceEventHandler(OnNeedDataSource);
    6    Grid1.PageIndexChanged += new ComponentArt.Web.UI.Grid.PageIndexChangedEventHandler(OnPageChanged);
    7    Grid1.SortCommand += new ComponentArt.Web.UI.Grid.SortCommandEventHandler(OnSort);
    8  }


  • 相关阅读:
    复杂json格式转化为javabean
    lambda常用方法
    solr设置分片和副本
    Python之Scrapy爬虫框架安装及简单使用
    40多个纯CSS绘制的图形
    windows下自动启动Redis隐藏命令行窗口
    用Webpack构建Vue项目
    上传本地代码到gitHub过程详解
    html/css常用合集
    数据库索引与b+树
  • 原文地址:https://www.cnblogs.com/simhare/p/879110.html
Copyright © 2011-2022 走看看