简体   繁体   English

如何通过网络连接到SQL Server数据库?

[英]How to connect to a sql server database over the net?

hello i am a beginner at programing and the problem that i have is how can i connect to a sql server database located on a server over the net from within a smart device project (windows mobile 6) 你好,我是编程的初学者,我遇到的问题是如何从智能设备项目(Windows Mobile 6)内通过网络连接到服务器上的sql服务器数据库

Server = my Server Address;Database = my Data Base;User Id = my User name;
Password = my Pass word;

what would i need to change? 我需要改变什么? or what other type of connection or string connection should i use? 还是我应该使用其他类型的连接或字符串连接?

Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;

can i use this if yes what network library represents and the ,1433 at the end of data source? 如果可以,我可以使用它吗?网络库代表什么,以及数据源末尾的,1433?

would i need to make any changes to the database located on the server using management studio? 我是否需要使用Management Studio对位于服务器上的数据库进行任何更改?

thank you! 谢谢!

You don't really need to change anything apart from maybe your SQL Server settings to make sure remote connections are allowed. 除了可以确保允许远程连接之外,您实际上不需要更改SQL Server设置以外的任何内容。

The , 1433 is the port (if I remember correctly the default port for SQL Server) therefore there is no additional library or anything. ,1433是端口(如果我没记错的话,是SQL Server的默认端口),因此没有其他库。 However, you would also need to make sure that the port is open on any firewall and forwarded to the database. 但是,您还需要确保该端口在任何防火墙上都是打开的,并已转发到数据库。

However, opening your DB across the internet is a very bad idea. 但是,通过Internet打开数据库是一个非常糟糕的主意。 It would be better to use a service layer on the server to expose an API for consumption by a client program. 最好在服务器上使用服务层来公开供客户端程序使用的API。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何连接到现有数据库? .NET Core API和SQL Server 2012 - How to connect to existing database? .NET Core API & SQL Server 2012 如何通过网络将单个SQL Server数据库连接到两个不同的C#WPF应用程序 - how to connect a single SQL server database to two different C# WPF applications over the network 如何解决无法连接到SQL Server数据库? - How to solve Unable to connect to SQL Server Database? 如何连接到 SQL SERVER 并将数据插入数据库? - How to connect to SQL SERVER and insert data into database? 如何使用Visual Studio 2015连接到ASP.NET中的本地SQL Server数据库? - How to connect to a local SQL Server database in ASP.NET using Visual Studio 2015? 如何使用Visual Studio 2013连接到asp.net中的本地SQL Server数据库? - How to connect to a local SQL server database in asp.net using Visual Studio 2013? 如何将 ASP.NET Core 5 MVC 项目连接到 Supabase 数据库而不是 SQL 服务器? - How to connect ASP.NET Core 5 MVC project to Supabase database instead of SQL Server? 如何连接到SQL Server并通过ASP.NET Web窗体查看数据库中的数据? - How can I connect to SQL Server and view the data in the database through ASP.NET Web Form? 如何将本地ASP.NET网站连接到远程Azure SQL Server数据库? - How to connect a local ASP.NET website to a remote Azure SQL Server database? .Net C#如何连接外部SQL Server数据库? OleDb还是其他? - .Net C# how to connect to external SQL Server database ? OleDb or other?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM