以数组为参数的方法


以数组为参数的方法
 
 
 public static void checkIsNumericParam(DataGridView dgv, params string[] headParam)
        {
            if (dgv.Rows.Count <= 1)
                return;

            foreach (DataGridViewRow dr in dgv.Rows)
            {
                foreach (string sHead in headParam)
                {
                    string sl = dr.Cells[sHead].Value.ToString().Trim();

                    if( string.IsNullOrEmpty( sl ) || sl.Equals("NULL"))
                        dr.Cells[sl].Value = 0;
                    else
                    {
                        if( !isNumberic ( sl )){
                            string str1 = " | " + sHead  + "NG";
                            dr.Cells["导入异常"].Value += str1;
                        }
                    }
                }


            }
        }


你可能感兴趣的:(String,null)