开发者

Resize Access Database Column/Field Programmatically with C#

开发者 https://www.devze.com 2023-01-02 17:53 出处:网络
If I know that a particular Text column exists in a table, how can I programmatically resize that field (say from 10 to 20) with C#? I don\'t want to use the method where 开发者_运维知识库I would crea

If I know that a particular Text column exists in a table, how can I programmatically resize that field (say from 10 to 20) with C#? I don't want to use the method where 开发者_运维知识库I would create a temporary column, copy the data over, drop the old column, and rename the new one. I'd like to preserve the orde.


Can you use c# to execute a DDL statement in the Access database? If so this one works from within Access:

CurrentDb.Execute "ALTER TABLE YourTable ALTER COLUMN YourTextField TEXT(20);"
0

精彩评论

暂无评论...
验证码 换一张
取 消