datatable Primary Columnhttp://forums.asp.net/t/1773660.aspx/1?datatable+Primary+ColumnSat, 25 Feb 2012 06:19:57 -050017736604850339http://forums.asp.net/p/1773660/4850339.aspx/1?datatable+Primary+Columndatatable Primary Column <p>Dear All,</p> <p>I am trying to get the index of a datatable primary key. Is that possible? I have a filled datatable, All I need is to get the index of its primary key.</p> <p>Thank you</p> <p>Ahmad</p> 2012-02-25T06:01:49-05:004850350http://forums.asp.net/p/1773660/4850350.aspx/1?Re+datatable+Primary+ColumnRe: datatable Primary Column <p>As you said, you are binding your data table and after that trying to get index of primary key, I believe firstly you will need to define primary key in your data table because when you bind a data table with a table in database, only data gets binded, not constraints.</p> <p>see link:</p> <p>http://msdn.microsoft.com/en-us/library/system.data.datatable.primarykey%28v=vs.71%29.aspx</p> 2012-02-25T06:19:57-05:00