Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Dim dstFile As String = "C:\temp\2.csv" Dim sjis As Encoding = Encoding.GetEncoding("Shift_JIS") Using stm As New StreamWriter(dstFile, False, sjis) 'ヘッダ行の書き込み Dim header = From col In DataGridView1.Columns.Cast(Of DataGridViewColumn)() _ Select col.HeaderText stm.WriteLine(String.Join(",", header)) 'データ行の書き込み For Each row In From r In DataGridView1.Rows.Cast(Of DataGridViewRow)() _ Where Not r.IsNewRow Dim contents = From cell In row.Cells.Cast(Of DataGridViewCell)() Select cell.Value stm.WriteLine(String.Join(",", contents)) Next stm.Close() End Using End Sub