Cannot connect to MSSQL database... Error

Here is my page while trying to install a mojoPortal site:

Welcome to mojoPortal Setup

Probing system...
File system permissions ok.
The system cannot connect to the MSSQL database. Please check your connection string.

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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.SqlClient.SqlConnection.Open() at mojoPortal.Data.dbPortal.DatabaseHelper_GetConnectionError(String overrideConnectionString)

This site appears to be running in a secured environment using Medium Trust policy or lower.

Server Error in '/' Application.
Session state has created a session id, but cannot save it because the response was already flushed by the application.
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.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application.
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:

[HttpException (0x80004005): Session state has created a session id, but cannot save it because the response was already flushed by the application.]
System.Web.SessionState.SessionIDManager.SaveSessionID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded) +2220274
System.Web.SessionState.SessionStateModule.CreateSessionId() +55
System.Web.SessionState.SessionStateModule.DelayedGetSessionId() +64
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +328
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

It looks like my connection string in the web.config is not written correctly, but I am not sure what I am doing wrong. Ticket system here at Jodo simply replied with a link to www.connectionstrings.com but no help as to which of those examples would help me out. Here is a copy of the connection string from my web.config:

<add key="MSSQLConnectionString" value="server=(64.71.***.*);UID=*******_admin;PWD=********;database=*******_mojodb" />
<add key="MSSQLOwnerPrefix" value="[dbo]." />

Can anyone help me out?
 
I think your problem is the ( ) around the IP number. They shouldn't be there. I just tried it with a DotNetNuke test site and got exactly the same error.

I know (local) is used to mean local machine but I think that's a special case.

If possible, you should probably use a host name rather than IP number. eg mssql3.m****here.biz or whatever. IP numbers are prone to errors and could potentially change one day.

Cheers
Ross
 
OK, I got the medium security/db connect issue resolved, but I still have this issue. I have included my error, as well as the post from mojoPortal developer, Joe, input:

Probing system...
File system permissions ok.
MSSQL database connection ok.
database permissions are sufficient to alter schema.
database initial schema needs to be created.


Server Error in '/' Application.
Session state has created a session id, but cannot save it because the response was already flushed by the application.
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.Web.HttpException: Session state has created a session id, but cannot save it because the response was already flushed by the application.

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:

[HttpException (0x80004005): Session state has created a session id, but cannot save it because the response was already flushed by the application.]
System.Web.SessionState.SessionIDManager.SaveSessionID(HttpContext context, String id, Boolean& redirected, Boolean& cookieAdded) +2220274
System.Web.SessionState.SessionStateModule.CreateSessionId() +55
System.Web.SessionState.SessionStateModule.DelayedGetSessionId() +64
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs) +328
System.Web.SessionState.SessionStateModule.OnEndRequest(Object source, EventArgs eventArgs) +152
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64


Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832

I have not encountered that error before. The setup page uses Response.Buffer, Response.Write and Response.Flush to update the page as things progress and the Flush is apparently causing some error in saving session state. But session state is not used in mojoPortal so if your control panel has a way to turn that off maybe it can get past this error and complete the setup. Its anIIS setting, not sure if its exposed to you in your control panel. I do not get this error when I run in medium trust locally.

Joe

Any input? Has anyone else gotten Mojo to work on Jodo?
 
I think you need to ask support to setup the database and directory permissions the same way they do for DotNetNuke. That should solve it.
 
I think you need to ask support to setup the database and directory permissions the same way they do for DotNetNuke. That should solve it.

That was done before I even tried mojo, back when I tried to get DNN to work and that didn't work out too well either... I'm not sure what my problem with asp is. :p ?(
 
You've got me interested in mojoPortal. I won't promise but I might try installing it myself on JodoHost in the next few days. I'll let you know how it goes and if I find anything useful that might help you.

I'm quite a DotNetNuke fan but I must admit mojoPortal looks interesting.

Ross
 
You've got me interested in mojoPortal. I won't promise but I might try installing it myself on JodoHost in the next few days. I'll let you know how it goes and if I find anything useful that might help you.

I'm quite a DotNetNuke fan but I must admit mojoPortal looks interesting.

Ross

Well, If you don't mind I will be calling on you some more because I am also trying to get a DNN site up and running and not having much luck with it either...
 
Follow-up on my dilemma. This is a copy from the mojoPortal developer:

12/3/2007 11:00:11 AM
The good news is I'm able to replicate this problem here in IIS on Vista. Since this error didn't used to happen under medium trust I can only guess its a tightening of security either in IIS7 or in the recent service pak for the .NET framework.

I'm looking into it now and will post again as soon as I have a solution. I will follow up with a new package for medium trust that can get past this exception.

Thanks,
Joe
12/3/2007 12:04:08 PM

I have this fixed locally. I will upload a new package of files later today and post again when its available.

Thanks,
Joe

So it looks like the issue was with the release of mojo and I happen to fall into the crack. It happens that the "Medium Trust" version of mojo is still being developed and I just happened to help it along some. :) I will post again once I have more information.
 
Well, If you don't mind I will be calling on you some more because I am also trying to get a DNN site up and running and not having much luck with it either...

I will see if I can do something next week too, but I know DNN works well
 
Back
Top