In my LINQ-to-SQL DAL, I'm getting a "Specified Cast Was Not Valid."
Here is the exact error:
System.InvalidCastException was unhandled by user code Message="Specified cast is not valid." Source="System.Data.Linq" StackTrace:
at System.Data.Linq.IdentityManager.StandardIdentityManager.SingleKeyManager`2.TryCreateKeyFromValues(Object[] values, V& v)
at System.Data.Linq.IdentityManager.StandardIdentityManager.IdentityCache`2.Find(Object[] keyValues)
at System.Data.Linq.IdentityManager.StandardIdentityManager.Find(MetaType type, Object[] keyValues)
at System.Data.Linq.CommonDataServices.GetCachedObject(MetaType type, Object[] keyValues)
at System.Data.Linq.ChangeProcessor.GetOtherItem(MetaAssociation assoc, Object instance)
at System.Data.Linq.ChangeProcessor.BuildEdgeMaps()
at System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode)
at System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode)
at System.Data.Linq.DataContext.SubmitChanges()
at DomainModel.Repository.Concrete.SqlClientRepository.InsertClientByUsername(String username, Client clientInfo) in C:\Documents and Settings\Owner\Desktop\CollectionTree v1.1\DomainModel\Repository\Concrete\SqlClientRepository.cs:line 99
at WebUI.Secure.Controllers.ClientAdminController.EditProfile(Client clientProfile) in C:\Documents and Settings\Owner\Desktop\CollectionTree v1.1\WebUI.Secure\Controllers\ClientAdminController.cs:line 69
at lambda_method(ExecutionScope , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) InnerException:
It is happening on my db.SubmitChanges().
Anyway, where in this exception is what types it is having trouble casting? It would help narrow it down if I knew what specific types it was having issues with. I can hover over the exception in Visual Studio but I don't know what properties to look at.