Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

Find keyfield in a DataTable

How can find out, if field in a DataTable is a keyfield ?
0
ICSAutomation
Asked:
ICSAutomation
  • 2
1 Solution
 
anyoneisCommented:
Examine the Constraints collection on the table.

David
0
 
rameedevCommented:
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
 
anyoneisCommented:
Is my response not correct? It is how I would do it.

David
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now