如何为包含.mdf文件的C#项目创建设置 [英] How do I create a setup for a C# project which contains .mdf file

查看:145
本文介绍了如何为包含.mdf文件的C#项目创建设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我使用C#和SQL(.mdf文件)创建了一个电话目录。我的程序在我的笔记本电脑上运行良好,没有任何错误。

现在,我想在另一台计算机上运行相同的程序。我怎样才能做到这一点?我该如何为此创建一个设置?

我必须正确处理连接字符串吗?





[我正在使用VS 2012]

提前致谢。

Hey

I have created a phone directory using C# and SQL (.mdf file). My program is running well on my laptop without any errors.
Now, I'd like to run the same program on a different computer. How can I achieve this? How am I supposed to created a setup for this?
I'll have to take care of the connection string right?


[I'm using VS 2012]
Thanks in advance.

推荐答案

有两种选择:

1.更改连接字符串。

2.使用.NET的inbuild数据库在这种情况下,您无需更改连接字符串,它将服务器的位置作为当前应用程序位置。
There are two options:
1. Change the connection string.
2. Use the inbuild database of the .NET in that case you need not change the connection string it will take the location of the server as the current application location.


这篇关于如何为包含.mdf文件的C#项目创建设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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