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

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jul 2009
Posts: 20
Reputation: arelius is an unknown quantity at this point 
Solved Threads: 0
arelius's Avatar
arelius arelius is offline Offline
Newbie Poster

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

 
0
  #1
Jul 30th, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: May 2009
Posts: 186
Reputation: jbisono is an unknown quantity at this point 
Solved Threads: 24
jbisono's Avatar
jbisono jbisono is online now Online
Junior Poster

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

 
0
  #2
Jul 30th, 2009
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.
If your already resolved your issue, flag it as solved.
José Bisonó
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 20
Reputation: arelius is an unknown quantity at this point 
Solved Threads: 0
arelius's Avatar
arelius arelius is offline Offline
Newbie Poster

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

 
0
  #3
Jul 30th, 2009
Yeah, I had to modify my select statement to retrieve the data. Thanks a lot jbisono
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC