Solved

Find keyfield in a DataTable

Posted on 2006-11-23
4
217 Views
Last Modified: 2012-05-05
How can find out, if field in a DataTable is a keyfield ?
0
Comment
Question by:ICSAutomation
  • 2
4 Comments
 
LVL 11

Expert Comment

by:anyoneis
ID: 18004333
Examine the Constraints collection on the table.

David
0
 
LVL 5

Expert Comment

by:rameedev
ID: 18006469
What you could do is to check for  "Unique" property for a particular column..this returns a bool value..If true it tells you that all the values in the this column for all rows is unique.

something like this

bool isUnique = ds.Tables[0].Columns[0].Unique
0
 
LVL 11

Accepted Solution

by:
anyoneis earned 75 total points
ID: 18171556
Is my response not correct? It is how I would do it.

David
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to call weather service by using asmx? 4 44
C# bracket error 3 36
tableview is not updating 1 22
How can I do Unit Testing with Session ? 1 13
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question