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.

Signature
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
************************************************
Think Outside the Box!
************************************************
> 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
[quoted text clipped - 3 lines]
>
> Thanks
Why are you including them in the query then? If you are pulling the stuff
over just to remove it, it's a waste every way around.

Signature
W.G. Ryan, eMVP
http://forums.devbuzz.com/
http://www.knowdotnet.com/williamryan.html
http://www.msmvps.com/WilliamRyan/
> 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
[quoted text clipped - 3 lines]
>
> Thanks
rguti - 10 Jun 2004 21:02 GMT
It was just as an example, I just need to know extra information about each
column as compared to the field in the table.
> Why are you including them in the query then? If you are pulling the stuff
> over just to remove it, it's a waste every way around.
[quoted text clipped - 14 lines]
> >
> > Thanks
William Ryan eMVP - 10 Jun 2004 21:38 GMT
Cool, but what do you want to delete it for? Are you including it just so
you can get that information? You can get that info from
Information_Schema.Columns if you're using Sqlserver

Signature
W.G. Ryan, eMVP
http://forums.devbuzz.com/
http://www.knowdotnet.com/williamryan.html
http://www.msmvps.com/WilliamRyan/
> It was just as an example, I just need to know extra information about each
> column as compared to the field in the table.
[quoted text clipped - 19 lines]
> > >
> > > Thanks