简体   繁体   English

Visual Studio-表单未使用sql数据库更新

[英]visual studio - form not updating with sql database

I have an issue where I have created a form, added a table through a DataSource to an SQL database. 我在创建表单,通过数据源向SQL数据库添加表的问题。 Everything has worked fine. 一切都很好。

I have now needed to change a column from varchar(8) to varchar(255) which has been done and is fine. 我现在需要将一列从varchar(8)更改为varchar(255),这已经完成并且很好。 My issue is that upon opening my form I have a red ! 我的问题是打开表格时,我有一个红色! on my columns saying ; 在我的专栏上说;

Column 'UserId' exceeds the MaxLength limit. 列“ UserId”超出了MaxLength限制。

It lets me add through the form to the database with no issue. 它使我可以毫无问题地将表单添加到数据库中。 But always populates this issue on form opening. 但是总是在表单打开时填充此问题。

Please may somebody point me in the right direction to get the form to update along with the SQL Database? 请有人指出正确的方向,以使表格与SQL数据库一起更新吗?

I assume it is the Adaptor but I very well may be wrong. 我认为它是适配器,但我很可能错了。 I am new to VS and I have not been able to find the correct answer so far so I am hoping for some advice. 我是VS的新手,到目前为止我还无法找到正确的答案,因此希望能提供一些建议。

Thanks! 谢谢!

您需要重新创建DataSource对象-它具有仍然具有旧长度限制的验证规则。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM