Strings are immutable, so str
has to be recreated over and over. If there are a lot of rows or columns, use a stringbuilder:
Dim sb As New StringBuilder
For r As Integer = 0 To DataGridSQLQuery.RowCount - 2
For c = 0 To DataGridSQLQuery.ColumnCount - 1
sb.Append( your text to add to the string )
sb.Append(Environment.NewLine)
txtMessageErreur.Text = sb.Tostring
sb.Clear ' reset for next iteration
Next c
Next r
The text will not line up in a textbox or listbox like columns, unless you use a monospace font. W
takes more room than i
. PadLeft/Right will help but not a lot