Error while shifting sharepoint site to MOSS 2007 , Sever 2003 from MOSS 2007, Server2008
- Hi,
Following is the scenario..
Configuration For Developer Server :
1)OS : Server 2003.
2)MOSS 2007 (SP2)
3)DB : SQLServer 2005
Configuration For Production Server :
1)OS : Server 2008.
2)Sharepoint : MOSS 2007(SP2)
3)DB : SQLServer 2005
We have MOSS 2007 on developer server machine. We added the asp.net pages on the sharepoint pages. For calling the List item we are using coding as follows.
string p_strSiteUrl="http://testserver/sites/testsite/RM/ ";
string l_strBookingNo = "";
SPWeb l_web = null;
SPSecurity.RunWithElevatedPrivileges(delegate()I have change the Settings of sql server 2005 for Surface area configuration to Database Engine->Remote Connection->Locat and remote connection->Using TCP/IP and Named Pipes. But still its not working, I am getting the same error. Its now 2 days i have googled arround and didnt find the solution. I dont know whether i am missing some settings or in the Server 2008 i need to do something else to make my coding to work. Please reply if some one have the experience to deal with sharepoint farm and Server 2008. Here are the error details.
{
using (SPSite l_site = new SPSite(p_strSiteUrl))
{
l_web = l_site.OpenWeb();
}
});
This coding works fine for development server. But now i am shifting site on the production server which is having different environment. On development server i was having the single server, but production server having database and application servers on different servers. I am getting the error whenever user access the custom pages on production server. Rest all the list item are accessible through the sharepoint list pages, only the custom pages have the problems for accessing the contents.
I have gone through the code, and I found that whenever i am trying to store anything in the session, that time i am getting this error. The session mode that i am using is SQLServer and connection string as "data source=localhost;Integrated Security=SSPI" . Do I have to mention some custom connection string while using database server as different server than the application server.
Server Error in '/_layouts/Test1' Application.
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)
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: 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)
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): 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.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +248
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +245
System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject) +475
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +260
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +2450585
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +2450280
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +354
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +703
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +54
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +2419176
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +92
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +1657
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +84
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +1649271
System.Data.SqlClient.SqlConnection.Open() +258
System.Web.SessionState.SqlStateConnection..ctor(SqlPartitionInfo sqlPartitionInfo) +292
[HttpException (0x80004005): Unable to connect to SQL Server session database.]
System.Web.SessionState.SqlSessionStateStore.ThrowSqlConnectionException(SqlConnection conn, Exception e) +2984636
System.Web.SessionState.SqlStateConnection..ctor(SqlPartitionInfo sqlPartitionInfo) +2981919
System.Web.SessionState.SqlSessionStateStore.GetConnection(String id, Boolean& usePooling) +254
System.Web.SessionState.SqlSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem) +207
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +775
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171
kapil- EditadoKapil Khadgi lunes, 06 de julio de 2009 17:50Did some more trial to get the solution
- EditadoKapil Khadgi lunes, 06 de julio de 2009 17:51Did more clear
Todas las respuestas
- Kapil,Is this issue resolved. I am also having same problem. My custom user control code is failing and it occurs whenever the code tries to save something in the session.please let me know if this issue is resolved for you.
- Can you tell us what line of code causes the exception to be thrown? If you can throw in some surrounding lines of code, it would be helpful.
Tim
Hi Kapil,
Assuming the instance name is correct
Assuming your sql server is configured to aalow remote comnnections
Looks like the application pool account has no Sql login or rights at the Sql server.
Try granting the application pool account sql login and accsss to the content DB's in question.
Hope this gets you in the right place.
Brian T

