M
Mark Olbert
I've run into problems using TableAdapters under VS2005 where the underlying Fill() method fails due to a constraint violation. This
occurs when there was no change to the data of the underlying table -- hence there shouldn't be a constraint problem, so far as I
can see -- but where the width of an nvarchar field changes (this occurs with SqlServer2005).
Apparently, the TableAdapter code is sensitive to width mismatches between the field in the table and the field as it is described
in the TableAdapter. That's not necessarily a bug...but the fact that reconfiguring the TableAdapter (by running its Configure
context menu command) doesn't solve the problem surely is.
Running the configuration command on a table where an nvarchar field's width has changed does not update the width specification for
the column in the TableAdapter. You have to go in and do that manually (or recreate the entire TableAdapter from scratch, which is
what I was doing early on...but that's a royal pain).
Needless to say, having to manually update for field width changes is a pain.
- Mark
occurs when there was no change to the data of the underlying table -- hence there shouldn't be a constraint problem, so far as I
can see -- but where the width of an nvarchar field changes (this occurs with SqlServer2005).
Apparently, the TableAdapter code is sensitive to width mismatches between the field in the table and the field as it is described
in the TableAdapter. That's not necessarily a bug...but the fact that reconfiguring the TableAdapter (by running its Configure
context menu command) doesn't solve the problem surely is.
Running the configuration command on a table where an nvarchar field's width has changed does not update the width specification for
the column in the TableAdapter. You have to go in and do that manually (or recreate the entire TableAdapter from scratch, which is
what I was doing early on...but that's a royal pain).
Needless to say, having to manually update for field width changes is a pain.
- Mark