I am counting `DataTable` `rows` with `int n = dt.Rows.Count`.
Further down in my method, inside several foreach loops and whatnot, I need to reference `int n`.
I basically don't know how to do that.

> 
> "The name 'n' does not exist in the current context"
> 
> 
> 

How can I reference it outside of its context?

How my code is built up (abbreviated):

```
try {
    using (DataTable dt = new("aTableName")) {
    // more SQL stuff

    foreach (DataRow dr in ds.Tables[0].Rows) {

    Collection.Add(New Class {

        // adding to properties
    });
}

int n = dt.Rows.Count; /* this is the int I am trying to reference */

```

further down I instantiate a list of the collection, and iterate through with a foreach loop. It's within that foreach loop that I need to reference the int.
Can it be done?