如何在进度数据库字符[]数据类型和C#字符串之间进行转换?

发布于 2024-07-11 20:23:39 字数 137 浏览 8 评论 0原文

进度数据库允许使用Character[x]数据类型。 如何使用 C# 和 ODBC 写入特定的 x?

除非您理解 Character[x] 的含义,否则请不要回答...它不是一个字符串(字符数组),它是一个字符串数组(它们是字符数组)。

Progress databases allow for a Character[x] datatype. How can I write to a particular x using C# and ODBC?

Please do not answer unless you understand the what Character[x] means... it is not a string (array of chars), it is an array of strings (which are arrays of chars).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

赠佳期 2024-07-18 20:23:39

我想到了。 我的文档引用了字符[20]的数据类型,格式x(24)。 字符[x](其中x是一个数字),就像一个字符串数组。 格式 x(24) 表示数组中的每个字符串可以是 24 个字符长。

本质上是字符[20],格式 x(24) 是一个长度为 20 * 24 个字符的字符串,每个“数组元素”之间用分号 (;) 分隔。

如果列“options”被定义为character[20], x(24),那么要使用从1到20的字符串填充它,只需编写:

row.options = "1;2;3;4;5;6; 7;8;9;10;11;12;13;14;15;16;17;18;19;20";

要使用所有空字符串填充它,请写入:

row.options = ";;;;;;;;;;;;;;;;;;;;";

I figured it out. The documentation I have refers to a datatype of character[20], format x(24). character[x] (where x is a number), is like an array of strings. Format x(24) means each string in the array can be 24 characters long.

Essentially characters[20], format x(24) is a string that is 20 * 24 characters long with each "array element" separated with a semi-colon (;).

If column "options" is defined as character[20], x(24) then to populate it with strings from 1 to 20, one would merely write:

row.options = "1;2;3;4;5;6;7;8;9;10;11;12;13;14;15;16;17;18;19;20";

To populate it with all empty strings write:

row.options = ";;;;;;;;;;;;;;;;;;;";

初见你 2024-07-18 20:23:39

格式x(24)表示数组中的每个字符串可以是24个字符长。

不太准确,该格式是 DISPLAY 格式,许多 Progress 例程在显示/打印/导出该字段时都使用该格式。 所有字符字段,无论是否有范围,都作为可变长度字符串存储在数据库中。 因此,您可以轻松地在 20 个扩展区中的每个扩展区中拥有最多约 32K 的数据。

Format x(24) means each string in the array can be 24 characters long.

Not quite accurate, the format is a DISPLAY format, which is used by a lot of the Progress routines when displaying / printing / exporting this field. All character fields, whether they have an extent or not, are stored on the DB as variable length string. So you could easily have up to about 32K worth of data in each of your 20 extents.

猥琐帝 2024-07-18 20:23:39

Progress ODBC 驱动程序指南 没有好像根本没有提到这种类型?

The Progress ODBC Driver Guide doesn't seem to mention that type at all?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文