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?