0

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)

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?

would i need to make any changes to the database located on the server using management studio?

thank you!

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Spiri
  • 21
  • 3

1 Answers1

0

You don't really need to change anything apart from maybe your SQL Server settings to make sure remote connections are allowed.

The , 1433 is the port (if I remember correctly the default port for SQL Server) therefore there is no additional library or anything. 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. It would be better to use a service layer on the server to expose an API for consumption by a client program.

Daniel Casserly
  • 3,552
  • 2
  • 29
  • 60
  • hello , thank you very much for your answers , can you be a little more explicit about the service layer? or should i use an ado connection? can i do that? – Spiri Mar 24 '15 at 12:23
  • hi, note the link I have added to the text which goes to MSDN's excellent intro to service layer guidelines. I don't use c# or SQL Server for service layer in my project but the principles will guide you I believe – Daniel Casserly Mar 24 '15 at 12:25