有关数据库连接的问题 [英] Questions about database connection

查看:90
本文介绍了有关数据库连接的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1。是否可以只分享已安装在我的电脑上的程序,以便连接到wifi的其他人可以使用它?



2.如何我可以将我的数据库字符串更改为永久?就像将我的C#应用​​程序安装到另一台计算机后,我想在不更改数据库字符串的情况下运行它?我真的需要使用SQL服务器吗?什么版本的sql server与我的visual studio ultimate 2013兼容?是否有任何兼容性,或者我可以使用任何版本的sql server?



3.是否可以使用仅使用wifi而不使用LAN的SQL服务器?我真的需要使用Windows Server 2008/2012,还是可以使用Windows 7,8.1,10?



提前感谢那些会回复的人。此外,您可以分享关于我上述问题的教程链接。



这是我的C#程序上的数据库连接..



我尝试过:



1. Is it possible to just share my program that is already installed in my computer so that the other who is/are connected to the wifi can use it?

2. How can i change my database string to permanent? Like after installing my C# application to another computer, i want to run it without changing the database string? Do i really need to use SQL server? What version of sql server is compatible with my visual studio ultimate 2013? Is there any compatibility on that or i can just use any version of sql server?

3. Is it possible to use SQL server using only wifi and not LAN? Do i really need to use windows server 2008/2012 or is it ok to use windows 7, 8.1 ,10?

Thank you in advance to those who will answer. Also, you can share links for tutorials about my questions above.

Here's my database connection on my C# program..

What I have tried:

SqlConnection con = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=C:\Users\HP\Documents\Visual Studio 2013\Projects\Coding\Coding\Coding.mdf;Integrated Security=True;Connect Timeout=30");

推荐答案

1。简短的回答是否定的。他们必须将它安装在他们的机器上。

话虽如此,答案更长,是的,花费很大。这将是一款名为Citrix XenApp的服务器软件。其他机器也必须安装客户端以连接到服务器。



2.您可以使用任何版本的SQL Server。真正的问题应该是,运行我的SQL代码需要什么版本的SQL Server?只有你能回答这个问题,因为只有你才能了解你的数据库代码。



你可以将你的连接字符串保存在代码可以拾取的地方,例如作为app.config文件。通常,您对连接字符串进行适当的更改作为应用程序的安装时间,但如果将连接字符串信息保存在用户可写的位置(例如C:\ProgramData \<下),也可以在运行时完成。 ;公司> \< appname>。



3. WIFI是局域网!你的问题毫无意义。不,您不能将其限制为仅一种类型的连接。但是,您可以通过巧妙使用防火墙来限制可以连接到服务器的网络子网。



您是否必须使用Windows的服务器版本。这取决于您正在使用的SQL Server版本。你可以使用Windows 7,8或10吗?是的,但您还必须了解您将从其他客户端计算机获得有限数量的同时连接。
1. The short answer is No. They have to install it on their machines.
Having said that, the longer answer is, yes, with great expense. This would be the not-so-little piece of server software called Citrix XenApp. The other machines would also have to have the client piece installed to connect to the server.

2. You can use any version of SQL Server. The real question should be, "what version of SQL Server is required to run my SQL code?" Only you can answer that question because only you are going to know anything about your database code.

You save your connection string in a place that the code can pickup, such as the app.config file. Usually, you make the appropriate changes to the connection string as install time of your app, though it can also be done at runtime if you save the connection string information in a user-writable place, like under C:\ProgramData\<company>\<appname>.

3. WIFI IS A LAN! Your question makes no sense. No, you can't limit it to just a single type of connection. You can, however, limit the network subnets that can connect to the server via clever use of firewalls.

Do you HAVE to use a server version of Windows. That depends on the edition of SQL Server you're using. Can you use Windows 7, 8, or 10? Yes, but you also have to understand that you will have a LIMITED number of simultaneous connections available to the machine from other client machines.


这篇关于有关数据库连接的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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