我如何“克隆"到现有的MS-Access DB使用C#? [英] How can I "clone" existing MS-Access DB using C#?

查看:113
本文介绍了我如何“克隆"到现有的MS-Access DB使用C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在C#中有一个小项目.

I have a small project in C#.

我现在可以阅读并保存(感谢上帝!)我现在需要允许用户使用新的db-new项目,但其结构像工作的项目一样

I can read and save now (thanks god!) I need now to allow the user to use new db-new project but structered like the working one

除了我需要将任何想法或示例导出到文本文件/CSV之外,还要做另存为"吗?谢谢!!!!

And also to do "save as" besides I need to export to text file/CSV any idea or sample? Thanks!!!!

推荐答案

保存起来很简单,遍历数据并将其输出到stringbuilder,然后使用File.WriteAllText .制作副本(如果没有其他方法),如果它是已知格式,则可以保留一个空的DB用作初始副本,并使用SQL将所有数据复制到新副本中.

Save as is easy, iterate over your data and output it to a stringbuilder, then use File.WriteAllText.  Making a copy, if nothing else works, if it''s a known format, you could keep an empty DB to use as an initial copy and use SQL to copy all the data into the new copy.


这篇关于我如何“克隆"到现有的MS-Access DB使用C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆