Jeff
10/3/2007 8:28:00 PM
I found that it is the following line of code that is causing the default
constraint to be created:
da.MissingSchemaAction = MissingSchemaAction.AddWithKey;
da is the SQLDataAdapter for the DataSet. This code existed when we were
using SQL 2000, so for some reason, when using SQL2005, the default
constraint is being created where it wasn't with SQL 2000. Also if I use
MissingSchemaAction.Add, it works fine with 2005.
What changed in SQL 2005 that causes this new behavior? Anyone know?
Jeff
"Jeff" wrote:
> It's understandably not the best way to go about this. This code was already
> in place when it came to me. It's rather not have to change it since it is
> part of our business environment and used everywhere. Isn't there a way to
> turn off this behavior in SQL 2005?
>
> "Cor Ligthert[MVP]" wrote:
>
> > Jeff,
> >
> > In fact are you misusing a DataSet as a kind of List class. However I cannot
> > say that I don't do that often although I use than a DataTable. But if this
> > list class is a part of your business environment, I would create a clear
> > (generic) list from it using the DataReader.
> >
> > Cor
> >