synology服务器上的C#program / SQL Database [英] C# program/SQL Database on synology server

查看:117
本文介绍了synology服务器上的C#program / SQL Database的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。



这可能是一个愚蠢的问题,编程对我来说相当新鲜。



我用C#编写了一个程序,它使用存储在我的驱动器上的数据库文件:

C:\Program Files(x86)\ Microsoft SQL Server \ MSSQL11.SQLEXPRESS \ MSSQL \DATA



我想和我的同事共享这个程序,所以我需要将数据库文件存储在我们常用的synology服务器上。



我该怎么办?如何更改数据库文件的位置?程序本身也将存储在synology服务器上的相同位置。



我希望我的问题很明确:)



最好的问候

stulli

Hi all.

This might be a stupid question, Programming is rather new to me.

I have written a program in C# and it uses database files stored on my c-drive:
C:\Program Files (x86)\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA

I want to share this program with my collegues, so I need to store the database files on our common synology server.

How do I do this? How do I change the location of the databasefiles? The program itself will also be stored at the same location on the synology server.

I hope my question is clear:)

best regards
stulli

推荐答案

嗯,你应该在你的Synergy服务器上安装一个MSSQL引擎,或者你只是想要分享数据文件吗?



假设您只想使用Synergy作为raid并拥有另一个中央数据库服务器?

您将获得网络传输时间,但它可能是可以忽略的。



无论您想要做什么是连接到您的MSSQL安装然后右键单击数据库并找到分离功能,记得检查关闭现有连接。



然后你的数据库似乎不见了,然后导航到数据文件夹并将它们移动到你的synergy服务器然后连接到您希望成为托管数据库服务器的托管数据库服务器,并从那里附加文件/>


您无法与不同的主机共享文件,因此您的同事不能同时使用相同的数据文件,但您可以使用相同的数据库进行协作在这种情况下,您甚至可以将数据库保留在您的计算机上,只需配置接受网络连接并授予他登录权限,但这是另一个问题,因为最好有一台指定的数据库计算机,因为它会很快获得其他数据库。



意外分离也是使用文件系统ctrl + c,ctrl + v进行备份的理想方式,目前为止最快:)
Uhm, well you should install a MSSQL engine on your Synergy server or you just want to share the datafiles?

Presuming you want to use Synergy as a raid only and have another central database server ?
You will the get a network transport time but it could be overlookable.

Regardless what you want to do is to connect to your MSSQL installation then right click on the database and find the detach functionality, remember to check the close existing connections.

Then you database seems gone, you then navigate to the data folder and move them to your synergy server and then connect to the database server you want to be the hosting db engine and attach the files from there.

you cannot share the files with different hosts, so your colleague cannot use the same datafiles as you are using at the same time, but you can collaborate using the same database and in such case you could even leave the database on your machine and just configure accept network connections and grant him a login, but that's another concern and of cause it is better to have a designated database machine as it will quickly get other databases.

incidently detaching is also an ideal way to take backups using filesystem ctrl+c, ctrl+v, by far the fastest :)


这篇关于synology服务器上的C#program / SQL Database的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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