Sunday, February 19, 2012

Connection string for MS SQLServer 2000

For nearly 6 wks I have been trying to workout with GoDaddy.com a connection string that will connect to the SQL Server 2000 from my ASP.Net web application. In my programming, I have placed the connection string in the web.config file and then call it from there within code behind using the SQLConnection object.
My web.config entry has the following form:

<appSettings>

<addkey="Conn"value="server=GoDaddyserver;integrated security=SSPI;database=databaseonGoDaddyserver;" />

</appSettings>
I have also written the key supplying the UID and pwd. Nothing works and their support is of no help.
Has anyone else had this difficulty either in general or with GoDaddy in particular?

Try the connectionstrings athttp://www.connectiosntrings.com. You would be using SQL Server authentication (standard security), notWindows authentication (trusted connection), so you will be specifyinga user name and password in the connection string.
|||Thanks, Terry. I've tried the connection string with the username and password in place of the trusted security--still no connection. The link you supplied does not seem to work.|||Sorry, I should have copied and posted it instead of typing it in:-) Hopefully you figured out my typo by now. It shouldhave beenhttp://www.connectionstrings.com.
|||Terri, I apologize for misspelling your name in my last reply. I wondered if that was the URL you meant. That's a great site and I have used it several times. Is it acceptable to ask if others would have a recommendation for a good ASP.Net hosting company? I just can't seem to work things out with GoDaddy.
Vern|||The best place for that hosting question is here:http://forums.asp.net/92/ShowForum.aspx. Try searching through theforum for suggestions, or post your own plea for help (realizing thatpeople representing ISPs hang out there and will be vocal that theirservice is the best).
With an IP address, the connection string should probably look like this:
"Data Source=127.0.0.1,1433;Network Library=DBMSSOCN;Initial Catalog=databaseonGoDaddyserver;User Id=yourSuppliedUserID;Password=yourSuppliedPassword;"

Without an IP address, the connection string should probably look like this:
"Data Source=SQL99.GoDaddy.com;Initial Catalog=databaseonGoDaddyserver;User Id=yourSuppliedUserID;Password=yourSuppliedPassword;"
What is the exact error you are receiving when you use the connection string with a user ID and password?

|||

Check your SQL Server user settings under Enterprise Manager and make sure that the username has permit rights to the database. Then if you want to be secure you will have to go to each table's security settings in that database and give the username select rights to the table. If you are using stored procs you will need to go to each proc and give the user name execute rights.
Also it would help if you would list us a code example of how you are using the connection string.

|||Terri, thanks for the hosting resource; here is the error:
Exception Details:System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:
[SqlException: SQL Server does not exist or access denied.] System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +474 System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372 System.Data.SqlClient.SqlConnection.Open() +384 VanDyke.StartUp.GetBio() in C:\VanDyke\default.aspx.vb:79 VanDyke.StartUp.Page_Load(Object sender, EventArgs e) in C:\VanDyke\default.aspx.vb:67 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +35 System.Web.UI.Page.ProcessRequestMain() +750
|||Part of my difficulty is that I have no management tool remotely similar to Enterprise Manager at GoDaddy, so I'm unsure of how they have users and privelges setup. I understand completely what you're recommending, however.
Code sample:

Dim connAsNew SqlConnection(ConfigurationSettings.AppSettings("Conn"))

conn.Open()

|||Can't you hook up your local Enterprise Manager to your remote GoDaddydatabase? I've been able to do this with the server I use asCrystalTech?
Otherwise, there are just so many possibilities. I am at a losswithotu seeing it for myself and working with it. It sounds likeyou need to give the user in your connection string permission toaccess your database. Without Enterprise Manager, I am not surehow to go about that. Doesn't GoDaddy give you *some* sort ofmanagement tool?
|||

The only other thing I can suggest is to make sure that your not having a DNS issue. Instead of using GoDaddy for the server name try using the ip address and see if that works.

|||Terri, GoDaddy management console only permits access to tables,veiws, and stored procedures; no way to get to users/permissions.
Using Enterprise Manager doesn't give me access as best I canfigure. I added a SQL Server Group which I named GoDaddy. Then tried to add a server registration, using the server address thatGoDaddy provides (whsql-v**.****.mesa*.secure***.net). Ielected SQL Server authentication and entered the user name andpassword I have that gives me access to the GoDaddy managementconsole--don't have a userID/pwd for the database server as best I cantell although I don't know that the credentials for the managementconsole aren't also intended to give database access. Anyway, Icannot establish a connection doing it as described.
|||It sounds like it is about time to contact the company you are hosting the Database with and ask them how your suppose to connect to the DB Server. Sounds like they don't even have an account on the box setup for you to use via ASP.NET. If you are paying for a service you should have access to it. I recommendwww.brinkster.com if this company can not statisfy your needs I would close my account and go with another company.|||

OldStretch wrote:

GoDaddy management console only permits access to tables,veiws, and stored procedures; no way to get to users/permissions.


Wow, that is the exact opposite of how Crystal Tech works.

OldStretch wrote:


don't have a userID/pwd for the database server as best I cantell although I don't know that the credentials for the managementconsole aren't also intended to give database access. Anyway, Icannot establish a connection doing it as described.


You didn't post an error message, but that is telling me the user nameand password are wrong. That is the crux of the problem. Ihighly doubt the management console user name and password would be thesame as that needed to access your database.
Don't they have support forums/documentation.anything? And you've been struggling with this for 6 weeks?

|||Does your SQL Server have an instance name? The conn string my need to be SERVERNAME/INSTANCENAME.

No comments:

Post a Comment