<p>I am binding an SPGridView to a SPList. As code samples suggest, I am using the following code to create a dataview based on the list. </p>

<pre><code>dim data as DataView = myList.Items.GetDataTable.DefaultView
grid.DataSource = data
etc...
</code></pre>

<p>What I am finding is that the column names in the resulting dataview do not always match the source fields defined in the SPList. For example I have columns named </p>

<ul>
<li>Description   </li>
<li>ReportItem</li>
<li><p>ReportStatus</p>

<p>these show up in the resulting dataview with column names like </p></li>
<li>ReportType0</li>
<li>ReportStatus1</li>
</ul>

<p>This leads me to think that I have duplicate field names defined, but that does not seem to be the case.</p>

<p>Seems like I am missing something fundamental here?
Thanks.</p>

The
```
GetDataTable
```
method is returning the
```
internalName
```
(or
```
staticName
```
-- I can't remember for sure which but they are frequently the same) representation of the columns, rather than the
```
Title
```
representation, which is what you see in the Web interface. I believe
```
GetDataTable
```
does a CAML query under the covers, and you have to use that
```
internalName
```
for field references in CAML.
This
blog
talks about it in a little more detail.