Hello,

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.