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
Dtabase sql server 2005 come file
giovedì 05 gennaio 2006 - 17.44
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
diska
Profilo
| Newbie
31
messaggi | Data Invio:
gio 5 gen 2006 - 17:44
nel mio progetto asp.net 2.0 ho il db usato come file locale
quando chiamo il metodo open e mi dice che
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)
il codice è questo
Dim conn As New System.Data.SqlClient.SqlConnection
Dim builder As New System.Data.SqlClient.SqlConnectionStringBuilder()
builder.DataSource = "Data Source=.\SQLEXPRESS"
builder.AttachDBFilename = "ASPNETDB.MDF"
builder.IntegratedSecurity = True
builder.UserID = "nomepc\utente"
System.Diagnostics.Debug.WriteLine(builder.ConnectionString)
conn.ConnectionString = builder.ConnectionString
Dim adapter As New System.Data.SqlClient.SqlDataAdapter("select * from User", conn)
Dim tbuser As New Data.DataSet
conn.Open()
qui mi da l'errore
se tento la connessione con i tool di visual studio va a buon fine anche sul file locale
diska
Profilo
| Newbie
31
messaggi | Data Invio:
gio 5 gen 2006 - 17:53
mi rispondo da solo che idiota
ho scritto builder.DataSource = "Data Source=.\SQLEXPRESS"
invece di builder.DataSource = ".\SQLEXPRESS"
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 !