I am using SQLServer2005 Express Edition in Visual Studio 2005. I uploaded the database to the server with the rest of the web files. When I try to insert data into a table, I receive the "error: 26 - Error Locating Server/Instance Specified" error message.
It is my belief that it is the connection string that is causing the problem. Currently the connection string looks like this:Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\MYDATABASE.mdf;Integrated Security=True;User Instance=True
Is there a way using VS2005 to create a username and pass for the database? Then how do I set up a typical connection string that will work on a web server?
Desired connection string format would be something like:
Data Source=??serverIP??;UID=MYusername;PASSWORD=MYpassword;SERVER=?serverIP/NAME?
The question marks are in there because I am not 100% sure what would go in those properties. Any help is appreciated.
Thanks,
KJAK
Are you sure that the sqlserver is installed in the server ? When you use .mdf files is necessary that the server have the sql server installed.
A connection string that will work on a web server is something like this:
connectionString="Data Source=SERVERIP;Initial Catalog=DATABASENAE;Persist Security Info=True;User ID=USER;Password=PASSWORD"providerName="System.Data.SqlClient"
|||SQLServer is installed on the server. The current connection string is provided from my development machine in the web.config file. I will try to adjust it to be similar to what you have posted.
I don't have full access to the server so I can't make any direct adjustments to SQLServer if that is needed. How can I create a username and password for the database using Visual Studio 2005?
|||SQLServer is installed on the server
which version of sql server is installed? express? or sql 2005?
But whatever,based on my understanding, in neither case you can create sql user name and passwork through visual studio. The sql database is managed by database management tool thus you can only create/modify user name and psw through management studio.
I don't have full access to the server so I can't make any direct adjustments to SQLServer if that is needed.
and based on my understanding, i think you must have admin previlage if you want to create new sql user accounts.
Hope my suggestion helps
No comments:
Post a Comment