C# 和 Sqlite 字段长度

标签 c# sqlite

我在 SQLite 中制作了一张表,并为一个字段选择了 varchar(30),但似乎我实际上可以保存更长的字符串,这正常吗?谁能给我解释一下?

最佳答案

是的,这很正常,并在 documentation 中进行了解释:

Note that numeric arguments in parentheses that following the type name (ex: "VARCHAR(255)") are ignored by SQLite - SQLite does not impose any length restrictions (other than the large global SQLITE_MAX_LENGTH limit) on the length of strings, BLOBs or numeric values.

(请注意,在看到这个问题之前,我对此一无所知。首先检查文档总是值得的。)

关于C# 和 Sqlite 字段长度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18002111/

相关文章:

android - 在基于 Android 的设备中使用 SQLite

c# - 带命令的 Crystal 报表未显示所有字段

c# - LDAP:枚举组织单位用户

c# - 如何在 C# 中动态创建 dll/exe?

android - 需要帮助将 achart-engine 与 android 数据库集成

android - 不要在消息中显示联系电话

sqlite - 无法链接到 libsqlite3.a 以创建我自己的静态库

c# - 如何从字节数组中选择特定范围

c# - c#中的嵌套类

python - 如何将 sqlite 3.8.2 升级到 >= 3.8.3