C#应用程序访问另一台计算机上的SQL Server [英] C# Application Accessing SQL Server on Another Machine

查看:163
本文介绍了C#应用程序访问另一台计算机上的SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在周一接受采访,并被要求提供一个应用程序,以展示我在C#和关系数据库(最好是SQL Server)中的技能.该应用程序不必运行,仅显示源代码即可,但是我希望能够进行演示.

问题在于,我在C#和SQL Server或与此相关的任何关系数据库方面所做的所有工作都已经在本地运行该数据库.

是否有免费的解决方案允许我的数据库在我的开发人员机器以外的机器上运行,以便雇主可以在不使用我的机器的情况下试用该应用程序并访问数据库?

如果这样,将数据库及其数据传输到解决方案是否足够容易?

非常感谢,
高级脆皮.

我现在意识到,免费的托管SQL Server解决方案的可能性不大.我可以将SQL Server临时托管在家用计算机上,关于需要在路由器上打开哪些端口的任何想法,以及如何对数据库的登录详细信息进行排序?

Hello all,

I have an interview on Monday and I have been asked to deliver an application that shows my skills in C# and relational databases, preferably SQL server. The application does not have to run, just show the source code, however I would like to be able to demonstrate it if possible.

The problem being, is that all the work I have done regarding C# and SQL server, or any relational database for that matter has had the database running locally.

Is there a free solution to allow my database to run on a machine other than my developer machine so that the employer can have play about with the application and access the database without the use of my machine?

If so is it easy enough to transfer the database and it''s data to the solution?

Thanks very much in advance,
Senior Crispy.

I realise now that a free solution for hosting a SQL server is probably unlikely. I could temporarily host SQL server on my home machine, any ideas on what ports I would need open on my router and how would I go about sorting the login details for the database?

推荐答案

您可以连接到远程计算机上托管的SQL数据库.要连接到数据库,托管服务器应允许远程连接.另外,您还应具有以下连接许可权.
1.连接到SQL Server.
2.连接到数据库,进行读写(如果需要).

SQL Server侦听1433端口(默认端口).

安装SQL Server Management Studio以查看数据库. SQL Server客户端允许您通过非常简单的步骤来备份/还原数据库.

请看以下MSDN文章.
如何:备份数据库(SQL Server Management Studio) [如何将SQL Server 2005配置为允许远程连接 [
You can connect to SQL database hosted on remote machine. To connect to the database, hosted server should allow remote connections. Also, you should have following permissions for connection.
1. Connect to SQL server.
2. Connect to database, read and write(if needed).

The SQL server listens on 1433 port (a default port).

Install SQL server management studio to view the databases. The SQL server client allows you to backup/restore the databases with pretty simple steps.

Look at following MSDN articles.
How to: Back Up a Database (SQL Server Management Studio)[^]
How to configure SQL Server 2005 to allow remote connections[^]


"是否有免费的解决方案,允许我的数据库在我的开发人员机器以外的其他机器"
是的.只有连接字符串会更改,并且需要将存在数据库的远程服务器配置为接受远程连接.

将数据库及其数据传输到解决方案是否足够容易
是的.使用SQL Server进行备份和备份;在其他系统上还原非常容易.
"Is there a free solution to allow my database to run on a machine other than my developer machine "
Yes. Only the connection string would change and remote server where database is present needs to be configured to accept remote connections.

is it easy enough to transfer the database and it''s data to the solution
Yes. With SQL Server, taking backup & restoring on other system is quite easy.


也许您可以将Access用作关系数据库后端而不是SQL.这个周末您将需要修改应用程序以查看Access ...
Perhaps you could use Access as your relational db backend instead of SQL. It would be more work for you this weekend to modify the app to look at Access...


这篇关于C#应用程序访问另一台计算机上的SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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