现有SQL数据库中更改数据字段宽度时出错. [英] Error on change data field width in existing SQL database.
问题描述
我有一个小型SQL数据库,该数据库具有一个应该为150个字符宽的字段.创建数据库时,我不小心将宽度设置为10.现在,我向数据库中添加了一些记录以进行测试,并且没有放入任何记录. 该字段中超过10个字符.当我最终超过该长度时,出现以下错误:
I have a small SQL database that has one field that was supposed to be 150 characters wide. When I created the database, I accidentally set the width to 10. Now I have added some records to the database for testing and didn't put in any records that were over 10 characters in that field. When I finally exceeded that length I got the following error:
System.Data.dll中发生了'System.ArgumentException'类型的未处理异常
An unhandled exception of type 'System.ArgumentException' has occurred in System.Data.dll
其他信息:无法设置列'dvd_?Genre',该值违反了此列的MaxLength限制.
Additional information: Cannot set column 'dvd_?Genre' the value violates thr MaxLength limit of this column.
我使用了开放式表格定义",将文件长度从10校正为150,并更新了表格.当我重新运行该应用程序时,我得到了相同的错误消息.有没有办法在不重新创建整个数据库的情况下增加字段的MaxLength?
I used the 'open table definition' and corrected the fiels length from 10 to150 and updated the table. When I reran the application I got the same error message. Is there a way to increase the MaxLength of the field without re-creating the whole database?
darby
推荐答案
如果您已将表中的列长从10更新为150.
If you have updated column length from 10 to 150 in Table.
然后您只需检查数据集/table就会根据数据库更改进行更新.
then you just check dataset /table is updated as per the database changes.
如果要通过视图刷新视图检索数据.
if you are retrieving data through view refresh view.
Ashish pandey
Ashish pandey
这篇关于现有SQL数据库中更改数据字段宽度时出错.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!