SHARE
TWEET

Untitled

a guest Jul 17th, 2017 40 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Name = Thomas
  2. Hair Color = Blonde
  3. etc...
  4.    
  5. Name
  6. Thomas
  7. Hair Color
  8. Blond
  9.    
  10. using (StreamWriter tw = new StreamWriter(openFileDialog1.FileName))
  11.           {
  12.             for (int row = 0; row < dgvParam.Rows.Count - 1; row++)
  13.           {  
  14.               for (int col = 0; col < dgvParam.Rows[row].Cells.Count; col++)
  15.                 {
  16.                   StringBuilder sb = new StringBuilder();
  17.                    if (!String.IsNullOrEmpty(sb.ToString()))
  18.                             sb.Append("=");  //any delimiter you choose
  19.                         sb.Append(dgvParam.Rows[row].Cells[col].Value.ToString().ToUpper());
  20.                     tw.WriteLine(sb.ToString());
  21.                 }
RAW Paste Data
Top