Last post Jan 15, 2016 01:30 PM by Yeoman
Dec 25, 2015 11:59 PM|Yeoman|LINK
I just spent an hour of debugging after a strange exception. I entered a new record into a database table and found that a varchar field was too small. I increased its size and entered the record.
Then, I got an exception in my application. I found that the DataSet code still used the smaller limitation for this field. I recompiled my app and even changed my web.config to force some recompilation, but the generated code in *Designer.cs still contained
the smaller limitation value. I had to change it by hand in the designer.
How do you cope with this? Can't you force to let all the DataSet/Designer code be recompiled?
Dec 28, 2015 03:19 AM|Candice Zhou|LINK
According to your description, you expand a varchar field size and it works fine in database, but it doesn't work in Dataset. Could you tell what exception you have gotten? Which line code throw the exception?
Jan 04, 2016 09:43 AM|Yeoman|LINK
thank you. Unfortunately I don't remember the exception. I think it was a message telling that data will be truncated.
However, I found the same problem again: A table attribute was removed, but it's still present in the TableAdapter. This again leads to exceptions when inserting/updating database records.
Do I really have to manually remove the attribute from the TableAdapter in the DataSet?
I would like to have a "Refresh" functionality that looks at the database and updates the DataSet...
Jan 05, 2016 09:38 AM|Candice Zhou|LINK
This again leads to exceptions when inserting/updating database records.
What the exceptions?
I would like to have a "Refresh" functionality that looks at the database and updates the DataSet
When you remove the attribute, has your database also updated?
Jan 15, 2016 01:30 PM|Yeoman|LINK
The exception should be clear: No such attribute!
I think the BLL generates some update SQL code like "UPDATE table SET attr1=val1, attr2=...". When some attribute is not present in the database table, an exception will be generated.
> When you remove the attribute, has your database also updated?
The other direction: I remove the attribute from the database table and it's still present in the TableAdapter...