Identity and primary keys

  • Thread starter Thread starter rguti
  • Start date Start date
R

rguti

I'm looping thru all the columns in a dataset that was filled from a SQL
Server table. I want to be able to exclude the columns that have an identity
key or are primary keys in SQL Server. Is there any method or property for
this in the dataset? or how do you go about getting that information for
each column?

Thanks
 
You can query the master database tables to figure out which are keys, but
there is nothing you can do in ADO.NET or your .NET code to automagically
remove primary keys and identity fields.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 
It was just as an example, I just need to know extra information about each
column as compared to the field in the table.
 
Back
Top