从 .net 类型数据集插入时,备注字段值被截断为大约 1000 个字符
我将其发布在这里是因为我在互联网上找不到任何有关此内容的信息。我希望它不要太本地化。
我有一个使用 Access 数据库的 asp.net 网站。在该网站中,我有一个类型化的数据集,它从包含一个备注字段的表中检索信息。数据库中的信息正确为红色。
当写回数据库(INSERT 或 UPDATE)时,备注字段的值似乎被截断为 1000 个多一点。
我跟踪了应用程序的执行情况,并且在调用 MyDataAdapter.Update(MyDataSet) 之前 DataSet 中的值没有被截断(调用之后也没有被截断)。但是该值在数据库中被截断。
这是怎么回事?
I'm posting this here because I can't find anything about this on the internet. I hope it's not too localized.
I have a asp.net web site that use an Access database. In the web site I have a typed DataSet that retrieve information from a table including one memo field. The information is correctly red from the Database.
When comes the time to write back to the database (INSERT or UPDATE) the value of the memo field seems to be truncated to little bit more than 1000 characters.
I traced the execution of my application and the value in the DataSet is not truncated before I call MyDataAdapter.Update(MyDataSet)
(neither is it after the call). However the value is truncated in the database.
What's going on here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在没有具体查看和测试的情况下,我会在连接后关闭表时查看列定义。每列都有自己的数据类型(数字、整数、文本等)。在基于字符的列上,列级别有一个“MaxLength”属性。我不知道是否可以将其设置为 1024 的以 2 为基数的倍数,这就是为什么它看起来像“略多于 1000 个字符”。
如果是这种情况,我会尝试以下操作,将 MaxWidth 更改为更大的值... 2048、4096、10000,等等。
Without seeing and testing specifically, I would look at the column definition as the table is brought DOWN after connection. Each column has their own data types (numeric, int, text, etc). On character based columns, there is a property at the column level for the "MaxLength". I don't know if that may be set to a base-2 multiple of 1024 which is why it looks like "little bit more than 1000 characters".
If that IS the case, I would try the following, change the MaxWidth to something larger... 2048, 4096, 10000, whatever.