How to get the "DataSource" in the Connection String ?
-
I am creating a web app. with sqlserver 2000 and if i host this app,how to get the "DataSource" in the Connection String which i use the web.config file for the DB Connection? Most of my friends use the ip address of the web server,is it a gud practise or there is any other way?
-
I am creating a web app. with sqlserver 2000 and if i host this app,how to get the "DataSource" in the Connection String which i use the web.config file for the DB Connection? Most of my friends use the ip address of the web server,is it a gud practise or there is any other way?
Why you need a DataSource in connection string? See http://www.connectionstrings.com/[^]
Navaneeth How to use google | Ask smart questions
-
I am creating a web app. with sqlserver 2000 and if i host this app,how to get the "DataSource" in the Connection String which i use the web.config file for the DB Connection? Most of my friends use the ip address of the web server,is it a gud practise or there is any other way?
Yes ip address or DataSource name given by your Service Provider is written in web.config and the "Key" will be used inyour code to call that connection string. eg. add key="xyz" value="server=209.xxx.xxx.xxx;user id=xyz;password=xyz;database=xyz"
-
I am creating a web app. with sqlserver 2000 and if i host this app,how to get the "DataSource" in the Connection String which i use the web.config file for the DB Connection? Most of my friends use the ip address of the web server,is it a gud practise or there is any other way?
IP address is fine, if you use a name, it needs to be resolved anyhow.
Christian Graus Driven to the arms of OSX by Vista.
-
I am creating a web app. with sqlserver 2000 and if i host this app,how to get the "DataSource" in the Connection String which i use the web.config file for the DB Connection? Most of my friends use the ip address of the web server,is it a gud practise or there is any other way?
Hi, You have to give the ip address or server name provided by your service provider in the connection string...,with out this you can not establish the connection to the server
-
I am creating a web app. with sqlserver 2000 and if i host this app,how to get the "DataSource" in the Connection String which i use the web.config file for the DB Connection? Most of my friends use the ip address of the web server,is it a gud practise or there is any other way?
Subin Alex wrote:
Most of my friends use the ip address of the web server,is it a gud practise or there is any other way?
This is depends where you DB server is. Your friend use IP Address of Web server as DB server, because of they have hosted Database and Web Sites in a Same System.
Subin Alex wrote:
is it a gud practise or there is any other way?
It depends on requirements and application. If its very small application then its fine. for large organization they always keeps it different.
cheers, Abhijit CodeProject MVP
-
Hi, You have to give the ip address or server name provided by your service provider in the connection string...,with out this you can not establish the connection to the server
thanx!