if (datfile[RowCount].ToString() != "" ) Below is my code: <pre lang="C#">for (int RowCount = startRec; RowCount <= endRec; RowCount++) { if (datfile[RowCount].ToString() != "" ) { if (RowCount == 0) { string[] column = datfile[RowCount].Split('þ'); for (int i = 0; i < column.Length - 1; i++) { if (column[i].ToString() != "") //if (column[i].ToString() != "" && column[i].ToString() != "\u0014") { DataGridViewTextBoxColumn dgvtxtcountry = new DataGridViewTextBoxColumn(); dgvtxtcountry.HeaderText = column[i].ToString(); dgvtxtcountry.Name = column[i].ToString(); dataGridView1.Columns.Add(dgvtxtcountry); cmbList.Add(column[i]); i += 1; } } } if (RowCount != 0) { dataGridView1.Rows.Add(); string[] column = datfile[RowCount].Split('þ'); int index = 0; for (int i = 1; i < column.Length - 1; i++) { if (column[i].ToString() != "\u0014") { dataGridView1.Rows[rowindex].Cells[index].Value = column[i].Trim('þ'); if (StaticVar.DateFormat != "" && StaticVar.DateFormat != null) { if (StaticVar.datecolidx == ((i - 1) / 2)) { dataGridView1.Rows[rowindex].Cells[index].Value = Convert.ToDateTime(column[i]).ToString(StaticVar.DateFormat); } } index += 1; i += 1; } } BuildDatString(rowindex); rowindex += 1; } } recNo += 1;</pre>
for (int RowCount = startRec; RowCount <= endRec-1; RowCount++) { if (datfile[RowCount].ToString() != "" )
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)