Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Is there a way to find programmatically the PRIMARY KEYs of a table in C#?
Is it done by some additional queries? Thanks :)
Posted
Comments
Amir Mahfoozi 29-Oct-11 7:31am    
When you mention C# it means that you have used Entity Framework or another ORM to access data. so you may find your answer by searching documents of your ORM provider. But if you are looking for a SQL command so mentioning C# is not logical. Don't you think so ?
ShacharK 29-Oct-11 9:25am    
Well, I was hoping that there was a way to find them using the SqlClient interfaces in C# (For example, I'm using it to get the table structures, columns and column types... So I was hoping (initially) that maybe I could use this interface to extract more data about the tables.

 
Share this answer
 
Comments
Abhinav S 27-Oct-11 3:22am    
Should be useful to the OP. 5.
Mehdi Gholam 27-Oct-11 3:33am    
Yep, thanks.
 
Share this answer
 
Comments
Mehdi Gholam 27-Oct-11 3:32am    
5'ed
Abhinav S 27-Oct-11 3:37am    
Thank you.
 
Share this answer
 
Comments
Amir Mahfoozi 29-Oct-11 7:27am    
+5
P.Salini 29-Oct-11 7:52am    
Thank You
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900