Setup And Getting Started Forum


Error for the first time run CMS

 
Pls help me to solve this error:
There is already an open DataReader associated with this Command which must be closed first.
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.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.
Source Error:
Line 46:                 string url = HttpContext.Current.Request.Url.Authority.ToLower();
Line 47:                 IEnumerable<Portal> portals = _inmemorycacheService.Get(PortalsHolder, () => _portalRepository.ListPortals());
Line 48:                 return portals.Where(portal => portal.URLAuthority.Equals(url)).FirstOrDefault();
Line 49:             }
Line 50: 
Source File: C:\Users\xxx\Desktop\MvcCms\MvcCms.Core\Cache\CacheService.cs    Line: 48



9 months 17 days ago by phuonglewis

Replies

Reply posted by jon 9 months 15 days ago View Branch And Reply
Wow, I have never seen that one. What version of SQL server are you using? Can you post your sql connection string again?
Reply posted by jon 9 months 15 days ago View Branch And Reply Answer
I googled the error and found this page
 
http://social.msdn.microsoft.com/Forums/en-US/sqldatabaseengine/thread/0a58d127-f532-44f1-8507-f9131228b5c1
 
Looks like you might need to check your named pipes setting. Enable the Protocols "Named Pipes" and it should work.
 
Here are some remarks they had
Quote:
Not sure if you have resolved this or not. I had the same error trying to connect to a new SQL Server 2005 installation with the management studio from a remote machine and discovered that the named pipes protocol was diasabled in the SQL Server network configuration protocols. I enabled it and restarted SQL Server and the problem was resolved.
Good Luck
Lane
 
 
 


Reply posted by phuonglewis 9 months 15 days ago View Branch And Reply
Following your link, I've enabled the Protocols "Named Pipes" and it works. I don't know what happened. Actually, when setup the db, I couldn't restore the mvccms.bak file and neither attach the MvcCms.mdf file. So I had to setup the db from running mvccms-full.sql file. Thank you so much, Jon. :)
Reply posted by jon 9 months 14 days ago View Branch And Reply
No problem, I am sure this thread will help someone else. I should add some type of "answer to question" functionality to the forum.
 
Have fun playing around with MVC I think it is great.
Reply posted by phuonglewis 9 months 14 days ago View Branch And Reply
Hi, Jon
Everything is ok but the ManageUsers action, following is the error when I enter this action:

The version of SQL Server in use does not support datatype 'datetime2'.
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.ArgumentException: The version of SQL Server in use does not support datatype 'datetime2'.

Source Error: 

Line 142:            DateTime compareTime = DateTime.Now.Subtract(onlineSpan);
Line 143:
Line 144:            return (from u in _entities.UserSet
Line 145:                    where u.LastActivityDate > compareTime &&
Line 146:                          u.Portal.PortalID == portal.PortalID

Source File: C:\Users\phuonglewis\Desktop\MvcCms\MvcCms.Data\EntityAccountRepository.cs    Line: 144
 1 2 3 4