在我们使用C#连接MS Access数据库之后,如何将我们的系统从计算机移动到另一台计算机? [英] After we connect MS Access database with C#, How to Move our system from a computer to another Computer?
本文介绍了在我们使用C#连接MS Access数据库之后,如何将我们的系统从计算机移动到另一台计算机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我这样连接了
I have connected like this
OleDbConnection connection = new OleDbConnection();
connection.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\mohamed.rifkan\Documents\Database2.accdb;
Persist Security Info=False;";
推荐答案
不要对数据库使用硬编码路径。您可以使用相对路径或DataDirectory,如此答案 [ ^ ]
Don't use hardcoded path for the database. you can use relative path or DataDirectory as described in This answer[^]
这篇关于在我们使用C#连接MS Access数据库之后,如何将我们的系统从计算机移动到另一台计算机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文