zoukankan      html  css  js  c++  java
  • 小操作

    string sqlCmd = string.Format("select COUNT(distinCt(BARCODE)) from [dbo].[SendAcerData] where INV_NO='{0}'", dtInv.Rows[i][0].ToString());
                            dtt = SqlHelper.Query(sqlCmd);
    字符串的格式化

    Split拆分后的是一个数组

    判断字符串为空

    string.IsNullOrEmpty(XXX)

    快速生成Get Set属性

    prop 按两下Tab

    选中一列的值

    列如

    string a;

    string b;

    选中string 加入ALT便可选中 方便修改。

    增加天数和时间格式转换

    将String日期转成DateTime再转成String

    string strSftDate=“20191016”;
    DateTime date=DateTime.ParseExact(strSftDate,"yyyyMMdd",System.Globalization.CultureInfo.CurrentCulture);
    strSftDate = date.AddDays(1).ToString("yyyyMMdd");
    //完成天数增加并且返回sting 因为DateTime格式时分秒去不掉
    View Code

     C# winform 定时器控件(看CSDN 作者una_ting的博客)

    timer_MainForm.Enable = true;

    timer_MainForm.Interval = 500;  //定时器时间间隔

    timer_MainForm.Start();   //定时器开始工作

    设置定时器属性

    定时实现的行为可在Tick事件中实现。

      private void timer_MainForm_Tick(object sender, EventArgs e)
     {
    
         //具体实现的方法
    
         //
    
    }
    View Code

    子控件事件冲突,无法实现Mouse事件,最后只能采取坐标的方法。

    DataGirdView中checkbox是否选中代码,Value不行选用EditedFormattedValue

    if ((bool)grdData.Rows[i].Cells["Select"].EditedFormattedValue==false )
    {
    
    }

     字符串四舍五入 取小数点后1位

    string WaitMinute;
    
    Convert.ToDouble(WaitMinute).ToString("0.0");//几个0取几位

     字符串不四舍五入 取小数点后1位

    string WaitMinute;
    double m3 = Math.Truncate((Convert.ToDouble(WaitMinute)) * 10) / 10;
  • 相关阅读:
    08 正则表达式
    07 函数&对象
    06 Math&Date&Json
    05 数组&字符串
    04 循环控制
    03 流程控制
    02 数据类型&运算符
    大道至简
    Avg_row_length是怎么计算的?
    理解innodb buffer pool
  • 原文地址:https://www.cnblogs.com/cdjbolg/p/11677095.html
Copyright © 2011-2022 走看看