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(); 
    喜欢请赞赏一下啦^_^
  • 相关阅读:
    Installing OpenSSH from the Settings UI on Windows Server 2019 or Windows 10 1809
    [CB]Intel 2018架构日详解:新CPU&新GPU齐公布 牙膏时代有望明年结束
    [百科]数字孪生
    wifi 标准
    WM_CONCAT和LISTAGG 语法例子
    Informix 启动 Fatal error in shared memory initialization解决方法
    B站日志系统的前世今生
    nginx安全日志分析脚本的编写
    可视化web日志分析工具Logstalgia
    CDH-5.7.0:基于Parcels方式离线安装配置
  • 原文地址:https://www.cnblogs.com/amadeuslee/p/3744681.html
Copyright © 2011-2022 走看看