Reply to topic
Please Help: Configuring VS2005 Web App to HMS SQL2005?
B3


Joined: 03 May 2006
Posts: 1
Location: Michigan
Reply with quote
Please forgive my inexperience & thank you for reading this...
Shocked 1) I understood the concept of ASP 1.1 web apps being directly connected to database hosted on shared server, BUT 2005 isnt billed to work that way, defaulting to a sql2005 file located in APPS folder that's housed directly in Web directory. HOW DO YOU SET UP A VS2005 APP TO DEFAULT TO USING A REMOTE SERVER LIKE HOSTMYSITE HAS???

Mad 2) HOW DO YOU GET THE AUTOMATICALLY GENERATED ASPNET MEMBERSHIP DATABASE TO WORK? I saw a prior post with no replies

Any help or reference is GREATLY appreciated! THanks.
jraybould


Joined: 29 Apr 2006
Posts: 46
Reply with quote
All you need is a simple connection string placed in your .NET code. For example, connectionstrings.com provides a great list of valid ways to connect to a SQL 2005 database using .NET:

For brevity I copied only one:


* Connect via an IP address:
"Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;"

(DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))


After you've assigned your string to a variable, use it like this:

SqlConnection conn = new SqlConnection(myConnectionString);

conn.Open();

doSomething();

conn.Close();
Please Help: Configuring VS2005 Web App to HMS SQL2005?
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic