FillSchema not bringing in UniqueConstraint column information
Posted on 2005-05-16
I have to to an upsert into a table with known format, but unkown constraints. The user database can be configured as they like, and I have to get my upsert command to handle this.
If my insert fails I go to my update command, but I can't seem to figure out how to get the unique constraints into the dataset from the table!
da is a sqlDataAdapter
ds is the dataset.
da.MissingSchemaAction = MissingSchemaAction.AddWithKey
da.FillSchema(ds, SchemaType.Source, tableName)
If there is a primary key I can get this information out of the local database, but I can't figure out a way to find the # of columns that make up the unique constraint on this table...
how can I get a list of those columns?
I've also tried dc.unique for each of the columns but it always returns false.
I'm expecting 4 or 5 columns in each table to make up the unique constraint. Help!