A
Anders Eriksson
I have this code, which I have copied from the documentation of the
Lumenworks CsvReader.
using (CachedCsvReader csv = new CachedCsvReader(
new StreamReader(openFileDialog1.FileName), true))
{
// Field headers will automatically be used as column names
dataGridView1.DataSource = csv;
}
Now as I understand by using 'using' the variables defined in it will be
destroyed after exiting the using clause. This would mean that the csv
variable will not exist outside of this.
How come that the values are still visible in the dataGridView1?
Do the datagridview copy all the values and csv is not needed anymore?
Should I use this code or is there a better way?
// Anders
Lumenworks CsvReader.
using (CachedCsvReader csv = new CachedCsvReader(
new StreamReader(openFileDialog1.FileName), true))
{
// Field headers will automatically be used as column names
dataGridView1.DataSource = csv;
}
Now as I understand by using 'using' the variables defined in it will be
destroyed after exiting the using clause. This would mean that the csv
variable will not exist outside of this.
How come that the values are still visible in the dataGridView1?
Do the datagridview copy all the values and csv is not needed anymore?
Should I use this code or is there a better way?
// Anders