Buz007
asked on
Deploying a .NET 4 app. with SQL Server 2005 on production server.
Hello all.
We are having problems trying to deploy a .NET 4 app. that use Data Entity Framework on our production server. The app work locally with SQL Server 2008 R2. but won't connect to the SQL Server 2005 on the production server.
The connection string used on the local system (with SQL server 2008) is as follow:
<add name="targaVC2Entities" connectionString="metadata =res://*/M odel1.csdl |res://*/M odel1.ssdl |res://*/M odel1.msl; provider=S ystem.Data .SqlClient ;provider connection string="data source=utilisateur-pc;init ial catalog=targaVC2;integrate d security=True;multipleacti veresultse ts=True;Ap p=EntityFr amework&qu ot;" providerName="System.Data. EntityClie nt" />
We sent many hours trying to run this app. on our production server without success.
We can reach a simple 'about' page but any attemps to reach a page which try to connect to the DB fails.
Any idea what needs to be modified in the connection string to solve this problem ?
Or any idea about the source of the problem ? (SQL 2005 config ? Compatibility issue ? anything else ... ?
Thank you for your help.
N. Bouchard
Targa Innovations
We are having problems trying to deploy a .NET 4 app. that use Data Entity Framework on our production server. The app work locally with SQL Server 2008 R2. but won't connect to the SQL Server 2005 on the production server.
The connection string used on the local system (with SQL server 2008) is as follow:
<add name="targaVC2Entities" connectionString="metadata
We sent many hours trying to run this app. on our production server without success.
We can reach a simple 'about' page but any attemps to reach a page which try to connect to the DB fails.
Any idea what needs to be modified in the connection string to solve this problem ?
Or any idea about the source of the problem ? (SQL 2005 config ? Compatibility issue ? anything else ... ?
Thank you for your help.
N. Bouchard
Targa Innovations
What is the compatibility level of the database that you used on the local system with SQL 2008? If you developed it using a later compatibility version than what SQL 2005 is then you could be running into some compatibility issues even though you are not utilizing the features that come in 2008.
any error message? are you using new features of SQL 2008 in your queries?
ASKER
Hi mcetlinski,
the reason is because the production server is win2003 with SQL 2005 and the development environment is windows 2008 and SQL 2008.
emoreau:
here's the error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
System.Data.SqlClient.SqlI nternalCon nection.On Error(SqlE xception exception, Boolean breakConnection) +5009598
System.Data.SqlClient.TdsP arser.Thro wException AndWarning () +234
System.Data.SqlClient.TdsP arser.Conn ect(Server Info serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity) +341
System.Data.SqlClient.SqlI nternalCon nectionTds .AttemptOn eLogin(Ser verInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, SqlConnection owningObject) +129
System.Data.SqlClient.SqlI nternalCon nectionTds .LoginNoFa ilover(Ser verInfo serverInfo, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, TimeoutTimer timeout) +239
System.Data.SqlClient.SqlI nternalCon nectionTds .OpenLogin Enlist(Sql Connection owningObject, TimeoutTimer timeout, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +195
System.Data.SqlClient.SqlI nternalCon nectionTds ..ctor(DbC onnectionP oolIdentit y identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +232
System.Data.SqlClient.SqlC onnectionF actory.Cre ateConnect ion(DbConn ectionOpti ons options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +185
System.Data.ProviderBase.D bConnectio nFactory.C reatePoole dConnectio n(DbConnec tion owningConnection, DbConnectionPool pool, DbConnectionOptions options) +33
System.Data.ProviderBase.D bConnectio nPool.Crea teObject(D bConnectio n owningObject) +524
System.Data.ProviderBase.D bConnectio nPool.User CreateRequ est(DbConn ection owningObject) +66
System.Data.ProviderBase.D bConnectio nPool.GetC onnection( DbConnecti on owningObject) +479
System.Data.ProviderBase.D bConnectio nFactory.G etConnecti on(DbConne ction owningConnection) +108
System.Data.ProviderBase.D bConnectio nClosed.Op enConnecti on(DbConne ction outerConnection, DbConnectionFactory connectionFactory) +126
System.Data.SqlClient.SqlC onnection. Open() +125
System.Data.EntityClient.E ntityConne ction.Open StoreConne ctionIf(Bo olean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFail ure) +52
[EntityException: The underlying provider failed on Open.]
System.Data.EntityClient.E ntityConne ction.Open StoreConne ctionIf(Bo olean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFail ure) +161
System.Data.EntityClient.E ntityConne ction.Open () +98
System.Data.Objects.Object Context.En sureConnec tion() +81
System.Data.Objects.Object Query`1.Ge tResults(N ullable`1 forMergeOption) +46
System.Data.Objects.Object Query`1.Sy stem.Colle ctions.Gen eric.IEnum erable<T>. GetEnumera tor() +38
System.Linq.Enumerable.Sin gle(IEnume rable`1 source) +108
System.Data.Objects.ELinq. ObjectQuer yProvider. <GetElemen tFunction> b__3(IEnum erable`1 sequence) +4
System.Data.Objects.ELinq. ObjectQuer yProvider. ExecuteSin gle(IEnume rable`1 query, Expression queryRoot) +24
System.Data.Objects.ELinq. ObjectQuer yProvider. System.Lin q.IQueryPr ovider.Exe cute(Expre ssion expression) +87
System.Linq.Queryable.Coun t(IQueryab le`1 source) +243
System.Web.UI.WebControls. EntityData SourceQuer yBuilder`1 .CompleteB uild(Objec tQuery`1 queryT, ObjectContext context, Boolean computeCount, Boolean wasExtended) +53
System.Web.UI.WebControls. EntityData SourceView .ContinueS electTyped (DataSourc eSelectArg uments arguments, EntityDataSourceQueryBuild er`1 queryBuilder, ObjectQuery`1 queryT, Boolean wasQueryModified) +91
System.Web.UI.WebControls. EntityData SourceView .ExecuteSe lectTyped( DataSource SelectArgu ments arguments, Creator qbConstructor) +2138
System.Web.UI.WebControls. EntityData SourceView .ExecuteSe lect(DataS ourceSelec tArguments arguments) +333
System.Web.UI.DataSourceVi ew.Select( DataSource SelectArgu ments arguments, DataSourceViewSelectCallba ck callback) +21
System.Web.UI.WebControls. DataBoundC ontrol.Per formSelect () +143
System.Web.UI.WebControls. BaseDataBo undControl .DataBind( ) +74
System.Web.UI.WebControls. GridView.D ataBind() +4
System.Web.UI.WebControls. BaseDataBo undControl .EnsureDat aBound() +66
System.Web.UI.WebControls. CompositeD ataBoundCo ntrol.Crea teChildCon trols() +75
System.Web.UI.Control.Ensu reChildCon trols() +102
System.Web.UI.WebControls. GridView.g et_Rows() +34
TargaVC_Configuration.Clie nts.Page_L oad(Object sender, EventArgs e) in S:\Noel\Projects\TargaVC_C onfigurati on\Clients .aspx.cs:1 7
System.Web.Util.CalliHelpe r.EventArg FunctionCa ller(IntPt r fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEvent HandlerDel egateProxy .Callback( Object sender, EventArgs e) +35
System.Web.UI.Control.OnLo ad(EventAr gs e) +91
System.Web.UI.Control.Load Recursive( ) +74
System.Web.UI.Page.Process RequestMai n(Boolean includeStagesBeforeAsyncPo int, Boolean includeStagesAfterAsyncPoi nt) +2207
thank you,
the reason is because the production server is win2003 with SQL 2005 and the development environment is windows 2008 and SQL 2008.
emoreau:
here's the error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)]
System.Data.SqlClient.SqlI
System.Data.SqlClient.TdsP
System.Data.SqlClient.TdsP
System.Data.SqlClient.SqlI
System.Data.SqlClient.SqlI
System.Data.SqlClient.SqlI
System.Data.SqlClient.SqlI
System.Data.SqlClient.SqlC
System.Data.ProviderBase.D
System.Data.ProviderBase.D
System.Data.ProviderBase.D
System.Data.ProviderBase.D
System.Data.ProviderBase.D
System.Data.ProviderBase.D
System.Data.SqlClient.SqlC
System.Data.EntityClient.E
[EntityException: The underlying provider failed on Open.]
System.Data.EntityClient.E
System.Data.EntityClient.E
System.Data.Objects.Object
System.Data.Objects.Object
System.Data.Objects.Object
System.Linq.Enumerable.Sin
System.Data.Objects.ELinq.
System.Data.Objects.ELinq.
System.Data.Objects.ELinq.
System.Linq.Queryable.Coun
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.DataSourceVi
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.WebControls.
System.Web.UI.Control.Ensu
System.Web.UI.WebControls.
TargaVC_Configuration.Clie
System.Web.Util.CalliHelpe
System.Web.Util.CalliEvent
System.Web.UI.Control.OnLo
System.Web.UI.Control.Load
System.Web.UI.Page.Process
thank you,
you are using the Named Pipes protocol. Add "Network Library=DBMSSOCN" to your connection string to use the TCP/IP protocol
ASKER
Hello emoreau,
Thank you for your quick answer !
It seems that we are making progress but not quite there yet:
After adding the Metwork Library string to the connection string we now get this exception:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No such host is known.)
Best ...
Noël
Thank you for your quick answer !
It seems that we are making progress but not quite there yet:
After adding the Metwork Library string to the connection string we now get this exception:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - No such host is known.)
Best ...
Noël
ASKER
mcetlinski:
Thank you ...
I just set the Compatibility level on the DB on my local system to SQL 2005 by running this Query:
ALTER DATABASE ``MyDB_Name
SET COMPATIBILITY_LEVEL = 90
And it runs ok, so i guess we can rule out the compatibility level issue.
Thank you ...
I just set the Compatibility level on the DB on my local system to SQL 2005 by running this Query:
ALTER DATABASE ``MyDB_Name
SET COMPATIBILITY_LEVEL = 90
And it runs ok, so i guess we can rule out the compatibility level issue.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.