private byte[] PrepareEBCDIC() { byte[] EBCDICHeader = new byte[3200]; NumberUnion fu = new NumberUnion(); for (int i = 0; i < 40; i++) { string s = dataGridView1.Rows[i].Cells[1].Value.ToString(); if (s == null) { s = " "; } if (s.Length > 80) { s = s.Substring(0, 80); } if (s.Length < 80) { s = s.PadRight(80); } myFile.Parameters[i].Value = s; BufferConverter.SetEBCDICBytesString(EBCDICHeader, fu, s, 80, 80 * i); } return(EBCDICHeader); }