|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Bug in TableAdapter Code Generator?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 Hi Mark,
It seems that this is the designed behavior of TableAdapter wizard. But I agree with you that this is a pain to manually update the field for a modified field. I will report this to the product team. Currently, you have to change it manually. Try to design the database first and change the size less. :-) Kevin Yu ======= "This posting is provided "AS IS" with no warranties, and confers no rights." |
|||||||||||||||||||||||