zoukankan      html  css  js  c++  java
  • 【Vegas原创】显示DataGrid中几行的数据

    System.DateTime currentTime=new System.DateTime(); 
                currentTime
    =System.DateTime.Now; 
                
    int year= currentTime.Year; 
                
    int month=currentTime.Month;
                
    int day = currentTime.Day;
                
    int column = day + 3+5;
                
    //int column= day +3-26;
                string strSql = "SELECT F1,F2,F3,F" + column + " FROM [Beol-DT$]";
                OleDbConnection conn 
    = new OleDbConnection(strConn); 
            
    //    OleDbCommand com =new OleDbCommand("SELECT F1,F2,F3,F7 FROM [Beol-DT$]",conn); 
                OleDbCommand com =new OleDbCommand(strSql,conn); 
                OleDbDataAdapter da
    =new OleDbDataAdapter(com); 
                DataSet ds
    =new DataSet(); 
                da.Fill(ds);
                
    for (int i = 10; i < 18; i++)                    //b
                {
                    ds.Tables[
    0].Rows[i].Delete();               //b

                }
            
    //    ds.Tables[0].Rows[17][0] = "Rework";

                for (int i = 25; i < 32 ; i++)                    //b
                {
                    ds.Tables[
    0].Rows[i].Delete();               //b

                }

                ds.Tables[
    0].AcceptChanges();                     //b
                DataGrid1.DataSource=ds.Tables[0].DefaultView;    
                DataGrid1.DataBind(); 
    喜欢请赞赏一下啦^_^
  • 相关阅读:
    Django 的简单ajax
    django 模板语言的注释操作
    Django 使用Paginator分页
    Django 使用allauth报错
    selenium登录 京东滑动验证码
    The usage of Markdown---表格
    The usage of Markdown---引用
    The usage of Markdown---代码块
    The usage of Markdown---目录
    The usage of Markdown---链接的使用
  • 原文地址:https://www.cnblogs.com/amadeuslee/p/3744681.html
Copyright © 2011-2022 走看看