I have a DataGridView that displays all the columns in the DataGridView Column from my database.

The problem I am having is that my Row_id column, which is the primary key of the table, will not display the data within the Row_id column.

Is there a way to retrieve the primary key of a record and display it in the DataGridView. Like I said, I have all of the other columns being properly displayed, but just can't seem to get this one.

Here is some other info regrading Row_id.

In SQL Server 2008 I set Identity Specification to "yes" with Identity Increment to "1" and Identity Seed to "1".

I need this primary key in order to do call stored procedures to delete and update.

Thanks a lot in advance.

8 Years
Discussion Span
Last Post by arelius

in your select statement are you retrieving that value? if yes verify you have autogeneratecolumns to false you have to create a bound column manually for the primary field and also you can set the visible property to false if you do not want people look at it, in the background you still can reference that column.


Yeah, I had to modify my select statement to retrieve the data. Thanks a lot jbisono

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.