943,568 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 835
  • C# RSS
Jul 30th, 2009
0

How come I can't very my primary key in DataGridView

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
arelius is offline Offline
28 posts
since Jul 2009
Jul 30th, 2009
0

Re: How come I can't very my primary key in DataGridView

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.
Reputation Points: 56
Solved Threads: 56
Posting Pro in Training
jbisono is offline Offline
431 posts
since May 2009
Jul 30th, 2009
0

Re: How come I can't very my primary key in DataGridView

Yeah, I had to modify my select statement to retrieve the data. Thanks a lot jbisono
Reputation Points: 10
Solved Threads: 0
Light Poster
arelius is offline Offline
28 posts
since Jul 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Testing Excel Option Button C#
Next Thread in C# Forum Timeline: how can i sum the sum of fields in crystal report C#





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC