Groups > Application developers > Community Server Setup and Installation > Re: Specified Cast is not valid Error on CS when trying to connect to CS database remotely after manual installation.




Specified Cast is not valid Error on CS when trying to
connect to CS database remotely after manual installation.

Specified Cast is not valid Error on CS when trying to connect to CS database remotely after manual installation.
Tue, 6 Nov 2007 06:51:22 +0000
Hi Guys,

After trying to setup CS and the separately the database on the remote db server
it gives me an error please refer below. I have done setting up the new
connection string to connection.config file that the manual installation
provided on the last step of the installation. We have not deleted the anonymous
user. We also use the connection string with other application we have. We have
done couple reinstallation of our database on the remote db server. I have
exhausted my resources but still cannot find solution with the problem we have.
Please help. Thank you.

 Server Error in '/' Application


Specified cast is not valid.
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.InvalidCastException: Specified cast is not valid.

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:



[InvalidCastException: Specified cast is not valid.]
  
CommunityServer.Components.CommonDataProvider.PopulateUserFromIDataReader(IDataR
eader dr, Boolean isEditable, Boolean includeAudit) +116
  
CommunityServer.Components.CommonDataProvider.cs_PopulateUserFromIDataReader(IDa
taReader dr, Boolean isEditable) +13
   CommunityServer.Data.SqlCommonDataProvider.GetUser(Int32 userID, String
username, Boolean isOnline, Boolean isEditable, String lastAction) +409
   CommunityServer.Users.GetUserFromDataProvider(Int32 userID, String username,
Boolean isOnline, Boolean isEditable, String lastAction) +39
   CommunityServer.Users.GetUser(Int32 userID, String username, Boolean
isOnline, Boolean isCacheable, Boolean fromCache) +800
   CommunityServer.Components.CSContext.get_User() +41
   CommunityServer.Components.CSLocation.ThemePage(ReWrittenUrl url) +38
   CommunityServer.Urls.Location.GetReWrittenUrl(ReWrittenUrl url, String path,
String queryString) +13
   CommunityServer.Urls.Location.GetReWrittenUrl(HttpContext context, String
path, String queryString) +143
   CommunityServer.Urls.UrlReWriteProvider.GetRewrittenUrl(HttpContext context)
+140
   CommunityServer.CSHttpModule.ReWriteUrl(HttpContext context) +23
   CommunityServer.Components.CSContext.ExecuteUrlReWrite() +23
   CommunityServer.CSHttpModule.Application_AuthorizeRequest(Object source,
EventArgs e) +123
  
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Exec
ute() +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
Post Reply
Re: Specified Cast is not valid Error on CS when trying to connect to CS database remotely after manual installation.
Fri, 9 Nov 2007 06:36:26 +0000
I am also having the exact same problem for days now. Have tried all suggestions
I've found in the forums: reinstalling the app, dropping and re-creating the
database, checking that i didn't delete the anonymous user, etc.  No luck. 

I can set up a connection string that works when pointing to a (temp) database
on the same machine, and I have another app running on the server that points to
my remote database that I'm trying to run CS on, connecting with no problems.
But when I try to run CS against the remote database, I get this Specified Cast
error over and over.

Any suggestions? Just about ready to drop CS from my evaluation list. 

 

Thanks,
Landon
Post Reply
Re: Specified Cast is not valid Error on CS when trying to connect to CS database remotely after manual installation.
Sun, 11 Nov 2007 17:18:05 +000
Have you run: 

exec dbo.cs_system_CreateCommunity 'localhost/cs', 'dev', 'admin@example.org',
'AdminUserName', 'AdminPassword', 0, 0

 on the database to create the community?
Post Reply
Re: Specified Cast is not valid Error on CS when trying to connect to CS database remotely after manual installation.
Mon, 12 Nov 2007 13:00:23 +000
Hi Nick,

 

Thank you for your reply. Yes I did the manual installation. Run the scripts
under installer\scripts directory within the web folder.
Post Reply
about | contact