Connexion base de données [Résolu]

Signaler
Messages postés
35
Date d'inscription
lundi 15 juin 2009
Statut
Membre
Dernière intervention
28 juillet 2009
-
Messages postés
6814
Date d'inscription
dimanche 15 décembre 2002
Statut
Modérateur
Dernière intervention
13 octobre 2010
-
onjour à tous, je suis sous Windows Server 2003 R2 SP1 et j'utilise SQL Server 2005.

Dans mon fichier web.config j'ai mis:
<!-- BEGIN TEMPLATE: bbcode_code -->

Code :

<connectionStrings>

</connectionStrings>

<!-- END TEMPLATE: bbcode_code -->

et quand jessaie de me connecter en faisant:
<!-- BEGIN TEMPLATE: bbcode_code -->

Code :

"
ProviderName="<%$ ConnectionStrings:bizoneConnectionString1.ProviderName %>" SelectCommand="SELECT TOP 8 [title], [price], [notes] FROM [titles] ORDER BY [pubdate]" />

<!-- END TEMPLATE: bbcode_code -->

le serveur me renvoie toujours:
<!-- BEGIN TEMPLATE: bbcode_quote -->

Citation:
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.

<!-- END TEMPLATE: bbcode_quote -->

J'ai essayé d'utiliser sql server surface area configuration, de cocher local and remote connections mais sans succès...

Je suis un peu bloqué là, je comprend pas trop en fait...

Merci à tous de votre aide!


Si cela peut vous aider à comprendre:
<!-- BEGIN TEMPLATE: bbcode_quote -->
Citation:





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 (0x80131904): 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)]

System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734995

System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188

System.Data.SqlClient.TdsParser.Connect(Boolean&
useFailoverPartner, Boolean& failoverDemandDone, String host,
String failoverPartner, String protocol, SqlInternalConnectionTds
connHandler, Int64 timerExpire, Boolean encrypt, Boolean
trustServerCert, Boolean integratedSecurity, SqlConnection
owningObject, Boolean aliasLookup) +820

System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String
newPassword, Boolean redirectedUserInstance) +628

System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity
identity, SqlConnectionString connectionOptions, Object providerInfo,
String newPassword, SqlConnection owningObject, Boolean
redirectedUserInstance) +170

System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
options, Object poolGroupProviderInfo, DbConnectionPool pool,
DbConnection owningConnection) +130

System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection
owningConnection, DbConnectionPool pool, DbConnectionOptions options)
+28

System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424

System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66

System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +496

System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82

System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory) +105

System.Data.SqlClient.SqlConnection.Open() +111

System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset,
DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior) +121

System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +137

System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83

System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770

System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17

System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149

System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70

System.Web.UI.WebControls.GridView.DataBind() +4

System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82

System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69

System.Web.UI.Control.EnsureChildControls() +87

System.Web.UI.Control.PreRenderRecursiveInternal() +41

System.Web.UI.Control.PreRenderRecursiveInternal() +161

System.Web.UI.Control.PreRenderRecursiveInternal() +161

System.Web.UI.Control.PreRenderRecursiveInternal() +161

System.Web.UI.Control.PreRenderRecursiveInternal() +161

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360

1 réponse

Messages postés
6814
Date d'inscription
dimanche 15 décembre 2002
Statut
Modérateur
Dernière intervention
13 octobre 2010
28
bonsoir,

il me semble pas que sql server 2005 accepte les bases de données "attaché comme un fichier" seul sql express le supporte car cela facilite le développement. Mais dans ton cas il te faut créer la base au niveau du server sql puis faire un attach database (ou un backup / restore)

<hr />Cyril - MSP - MCPD ASP.net & MCTS SQL