# \[ASP.NET & C#\] TableAdapter-problem

**URL:** <https://forum.kirupa.com/t/asp-net-c-tableadapter-problem/254577>\
**Category:** programming\
**Created:** [March 13, 2008, 10:21am UTC](https://forum.kirupa.com/t/asp-net-c-tableadapter-problem/254577 "2008-03-13T10:21:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Danneman](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@Danneman](https://forum.kirupa.com/u/Danneman)\
**Post date:** [March 13, 2008, 10:21am UTC](https://forum.kirupa.com/t/asp-net-c-tableadapter-problem/254577/1 "2008-03-13T10:21:02Z")

</div>

Ive got a DataSet.TableAdapter which has a query named GetPost(ID) that returns the four columns’ values in the specified row of the databases table.

The SQL-query is as follows:

SELECT ID, Date, Headline, Text  
FROM tblPosts  
WHERE (ID=@id)

The problem is that I dont know how to extract one of these values (ex. Headline) from the DataTable-object that I get in return by calling the SQL-query (via GetPost(ID)).

Ive tried the following codesnippet, but I only end up with the name of the column (ie. I get “Headline” as returnvalue), not the actual value in the specified row of that column:

string strHeadline = myTableAdapter.GetPost(ID).Columns[2].ToString();

So what I really want is the value in column 2 (ie. the Headline-column), not the name of the column. How do I do that?
