如何在其他计算机上使用mdf文件 [英] How to use mdf file on other computer

查看:91
本文介绍了如何在其他计算机上使用mdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过连接到MDF文件用C#开发了应用程序窗口表单。它可以在我的计算机上运行但其他计算机无法连接到MDF文件。

I have developed application window form with C# by connect to MDF file. It work on my computer but other computer can not connect to MDF file.

推荐答案

从您的评论中可以看出,您尝试连接到实例(本地实例)显然不存在的SQL(快速版)...

你有3个选择:

1.将你的数据库嵌入到应用程序中,所以当你打包你的应用程序安装程序还将包含必要的SQL引擎

2.安装SQL的本地副本并将mdf fie附加到它

3.使用每个远程SQL服务器计算机
From your comments it is clear that you try to connect to an instance (local instance) of an SQL (express edition) which obviously does not exists...
You have 3 options:
1. Embed your database in the application, so when you package your application the installer will contain also the necessary SQL engine
2. Install a local copy of SQL and attach the mdf fie to it
3. Use a remote SQL server from every computer


问题很可能是实例名称错误或实例未在本地计算机上运行。



参见 SQL网络接口,错误:26 - 找到指定的服务器/实例时出错 [ ^ ]
The problem most likely is that the instance name is wrong or the instance is not up and running on your local computer.

See SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified[^]


现在我可以通过以下方式在其他计算机上使用MDF文件:

- 为我的程序制作包安装程序。

- 在其他计算机上安装的SQL Server Express将运行它

- 已安装的程序遵循设置向导

- 设置MDF文件的授权访问权限



这样我就可以毫无错误地运行我的程序



谢谢Kornfeld Eliyahu Peter和Suvendu Shekhar吉里的帮助
Now I can use MDF file on other computer by:
- Made package installer for my program.
- Installed SQL Server Express on other computer which will run it on
- Installed program follow setup wizard
- Set authorize access for MDF file

So that I can run my program without any error

Thank you Kornfeld Eliyahu Peter and Suvendu Shekhar Giri for your help


这篇关于如何在其他计算机上使用mdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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