Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
SQL Server 2000/2005/2008, Express, Access, MySQL, Oracle
Server Error in '/' Application.
giovedì 19 aprile 2007 - 18.16
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
amedeo
Profilo
| Newbie
16
messaggi | Data Invio:
gio 19 apr 2007 - 18:16
Salve a tutti,
Ho pubblicato un sito ma quando cerco di connetermi al DB mi da il seguente errore:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
In locale va tutto bene ma l'accesso su IE mi genera errore, il sito è stato fatto con VS 2005 professional.
Grazie per le risposte
Saluti Amedeo
martinez
Profilo
| Senior Member
274
messaggi | Data Invio:
gio 19 apr 2007 - 22:34
Ciao
Il problema è sicuramente relativo alla stringa di connessione... controlla che la stringa di connessione che hai uploadato sul server sia giusta, cioè che punti al database presente sul server e non a quello locale della tua macchina!
Saluti
amedeo
Profilo
| Newbie
16
messaggi | Data Invio:
dom 22 apr 2007 - 06:29
Grazie per la risposta,
Ho iniziato adesso a cimentarmi con VS 2005. Come faccio a collegarlo al DB del server?
Grazie Amedeo
martinez
Profilo
| Senior Member
274
messaggi | Data Invio:
dom 22 apr 2007 - 09:46
per rispondere alla tua domanda dovrei conoscere per bene i parametri del tuo hosting SQL... in linea generale nel caso in cui si tratti di SQL 2005 è facile ricondursi a questa regola di base:
immettere nel proprio web.config una stringa di connessione come questa:
<add name="objConn" connectionString="Data Source=XXX.XXX.XXX.XXX;User ID=latuauser;password=latuapassword"
providerName="System.Data.SqlClient"/>
i parametri sopra elencati tipo: Data Source; User ID e password se non li conosci devi chiederli al tuo provider che ti fornisce lo spazio SQL
per completezza, è possibile richiamare dalla propria applicazione la connessione utilizzando qualcosa di simile:
SqlConnection objConn = new SqlConnection(ConfigurationManager.ConnectionStrings["objConn"].ConnectionString);
spero di essere stato utile ciao!
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !