Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 278
  • Last Modified:

Connecting to a remote database ....

In .NET (or for that matter any language or platform), if we have the IP address of a remote server, which is on the internet, can we connect to it, and access the RDBMS on it ?
0
moko
Asked:
moko
  • 4
  • 3
  • 2
  • +1
1 Solution
 
cookreCommented:
I use GetDriveType() to step through drive letters looking for an available one, use WNetAddConnection2() to map a drive to the remote, then have at it with, among others, OleDbConnection.
0
 
Éric MoreauSenior .Net ConsultantCommented:
0
 
fozyletCommented:
"Provider=sqloledb;Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"

see http://www.connectionstrings.com/
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
cookreCommented:
Fozy, are those credentials to the box or the DB?
0
 
bhagyeshtCommented:
you can connect most databases which have a server ie SQL server, MySql, oracle those that dont have a server component cannot be connected directly ie access/foxpro/txt.
if you want to connect access then you need to do it using VPN
0
 
bhagyeshtCommented:
if yoiu want to use access you can use it via msde this will treat access database as an sql server
0
 
fozyletCommented:
cookre:

those are for the db (i.e. uid/pwd)
no need to logon to the box to access the sql server

0
 
fozyletCommented:
Const ConnStrWeb   = "Server=172.21.9.39;Provider=SQLOLEDB;Database=cmsmaster;UID=web_user;password=pwd007"

This is a connection string i use for SQL server
but it is intranet (not internet). Guess that should work for internet too.
0
 
fozyletCommented:
moko:

please maintain your questions

Questions Asked  7
Questions Open  5
Questions Graded:  2
Questions Deleted:  0
Last 10 Grades Given:  B A
0
 
bhagyeshtCommented:
moko: can we have some feedback?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now