Using remote data in Windows APP...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everybody,

I wanted to develop a windows based application in C# which will use
remotely located SQL server via internet. Please tell me how to do this .. as
i don't have the any idea about how to connect to SQL server remotely over
the internet...

Thanks in Advance...
Regards
Anil K Bhardwaj
 
Anil:

The SQL server must be accessible through a public port (the default being
1433).

On the client side, MDAC (2.6 or higher) must have been installed (if you've
visual studio or windows server 2003, it's already installed).

Your connection string should look like
SERVER=[ServerName]\[InstanceName]:[PortNumber];UID=<UserID>;PWD=<Password>;DATABASE=<DatabaseName>

Many a times a single default instance is installed. In that case you don't
need InstanceName. If the server is listening at default port 1433, you
don't need to mention port number. If you've Client Network Utility, you can
use that to create an alias [AliasName] for
[ServerName]\[InstanceName]:[PortNumber]. Then your connection string would
look like
SERVER=[AliasName];UID=<UserID>;PWD=<Password>;DATABASE=<DatabaseName>

Ram
 
I would strongly advise against opening a public SQL port on the internet.
A much better approach would be to use web services to return datasets,
keeping your SQL server safely hidden behind a firewall. Ideally, the web
service layer should call a data layer to get those datasets. MSDN has
many, many examples and tutorials on how to accomplish this.

HTH,

Mike Rodriguez



Ram P. Dash said:
Anil:

The SQL server must be accessible through a public port (the default being
1433).

On the client side, MDAC (2.6 or higher) must have been installed (if
you've visual studio or windows server 2003, it's already installed).

Your connection string should look like
SERVER=[ServerName]\[InstanceName]:[PortNumber];UID=<UserID>;PWD=<Password>;DATABASE=<DatabaseName>

Many a times a single default instance is installed. In that case you
don't need InstanceName. If the server is listening at default port 1433,
you don't need to mention port number. If you've Client Network Utility,
you can use that to create an alias [AliasName] for
[ServerName]\[InstanceName]:[PortNumber]. Then your connection string
would look like
SERVER=[AliasName];UID=<UserID>;PWD=<Password>;DATABASE=<DatabaseName>

Ram

A. K. Bhardwaj said:
Hi everybody,

I wanted to develop a windows based application in C# which will use
remotely located SQL server via internet. Please tell me how to do this
.. as
i don't have the any idea about how to connect to SQL server remotely
over
the internet...

Thanks in Advance...
Regards
Anil K Bhardwaj
 
Thanks both of you for your valueable suggestions.
Regards
A. K. Bhardwaj

Michael Rodriguez said:
I would strongly advise against opening a public SQL port on the internet.
A much better approach would be to use web services to return datasets,
keeping your SQL server safely hidden behind a firewall. Ideally, the web
service layer should call a data layer to get those datasets. MSDN has
many, many examples and tutorials on how to accomplish this.

HTH,

Mike Rodriguez



Ram P. Dash said:
Anil:

The SQL server must be accessible through a public port (the default being
1433).

On the client side, MDAC (2.6 or higher) must have been installed (if
you've visual studio or windows server 2003, it's already installed).

Your connection string should look like
SERVER=[ServerName]\[InstanceName]:[PortNumber];UID=<UserID>;PWD=<Password>;DATABASE=<DatabaseName>

Many a times a single default instance is installed. In that case you
don't need InstanceName. If the server is listening at default port 1433,
you don't need to mention port number. If you've Client Network Utility,
you can use that to create an alias [AliasName] for
[ServerName]\[InstanceName]:[PortNumber]. Then your connection string
would look like
SERVER=[AliasName];UID=<UserID>;PWD=<Password>;DATABASE=<DatabaseName>

Ram

A. K. Bhardwaj said:
Hi everybody,

I wanted to develop a windows based application in C# which will use
remotely located SQL server via internet. Please tell me how to do this
.. as
i don't have the any idea about how to connect to SQL server remotely
over
the internet...

Thanks in Advance...
Regards
Anil K Bhardwaj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top