This question is locked. New answers and comments are not allowed.
Hey all,
I am getting an error when I attempt to do a basic "Customer" insert using the Telerik ORM in a website.
I have 4 facets to my site...
TestProject.Web
TestProject.Data
TestProject.Services
TestProject.Test
TestProject.Data has the objects created by the wizard in the DB->classes approach. TestProject.Services is the location of my actual code for using the object. For example, the web has an IAuthService which has a method "InsertTestSubject()" which is...
When I run this code in my website I get the following error:
Can anyone assist me in what I am doing wrong? After the above method I woudl assume I delegate all the work to the Telerik ORM tool.
R.
I am getting an error when I attempt to do a basic "Customer" insert using the Telerik ORM in a website.
I have 4 facets to my site...
TestProject.Web
TestProject.Data
TestProject.Services
TestProject.Test
TestProject.Data has the objects created by the wizard in the DB->classes approach. TestProject.Services is the location of my actual code for using the object. For example, the web has an IAuthService which has a method "InsertTestSubject()" which is...
public bool InserTestSubject() { |
IObjectScope scope = Database.Get("DatabaseConnection1").GetObjectScope(); |
//you could see in some expamples that this can also be done with |
//Database.Get("DatabaseConnection1").GetObjectScope(); |
//there is absolutely no diference |
using (scope) |
{ |
scope.Transaction.Begin(); |
Customer c = new MyProject.Data.Model.Customer(); |
c.FName = "Joe"; |
c.LName = "Test"; |
c.PassEncrypted = "testpass"; |
scope.Add(c); |
scope.Transaction.Commit(); |
} |
return true; |
} |
When I run this code in my website I get the following error:
Server Error in '/' Application. |
-------------------------------------------------------------------------------- |
Expected attribute 'name' in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\acb7afa6\3da5a3c9\assembly\dl3\02efd698\f650932c_f574c901\TestProject.Data.DLL:(resource)TestProject.Data.App.config:mapping-id=mssqlMapping:package[TestProject.Data.Model]/class[].class |
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: Telerik.OpenAccess.OpenAccessException: Expected attribute 'name' in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\acb7afa6\3da5a3c9\assembly\dl3\02efd698\f650932c_f574c901\TestProject.Data.DLL:(resource)TestProject.Data.App.config:mapping-id=mssqlMapping:package[TestProject.Data.Model]/class[].class |
Source Error: |
Line 12: { |
Line 13: public bool InsertTestUser() { |
Line 14: IObjectScope scope = Database.Get("DatabaseConnection1").GetObjectScope(); |
Line 15: //you could see in some expamples that this can also be done with |
Line 16: //Database.Get("DatabaseConnection1").GetObjectScope(); |
Source File: C:\Projects\TstProject\TestProject\TestProject.Services\Authentication\AuthenticationService.cs Line: 14 |
Stack Trace: |
[OpenAccessException: Expected attribute 'name' in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\acb7afa6\3da5a3c9\assembly\dl3\02efd698\f650932c_f574c901\TestProject.Data.DLL:(resource)TestProject.Data.App.config:mapping-id=mssqlMapping:package[TestProject.Data.Model]/class[].class] |
Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e) +28 |
Telerik.OpenAccess.RT.ExceptionWrapper.Throw() +34 |
OpenAccessRuntime.metadata.parser.MetaDataParser.getReqAttr(SaxAttributesSupport attr, String name) +275 |
OpenAccessRuntime.metadata.parser.MetaDataParser.startClass(SaxAttributesSupport attr) +434 |
OpenAccessRuntime.metadata.parser.MetaDataParser.startElementImp(String uri, String localName, String name, SaxAttributesSupport attr) +374 |
OpenAccessRuntime.metadata.parser.MetaDataParser.startElement(String uri, String localName, String name, SaxAttributesSupport attr) +75 |
[OpenAccessException: startElement] |
Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e) +28 |
Telerik.OpenAccess.RT.ExceptionWrapper.Throw() +34 |
OpenAccessRuntime.metadata.parser.MetaDataParser.startElement(String uri, String localName, String name, SaxAttributesSupport attr) +142 |
OpenAccessRuntime.metadata.parser.MetaDataParser._parse(XmlReader reader) +409 |
OpenAccessRuntime.metadata.parser.MetaDataParser._parse(XmlNode mappingXmlNode) +72 |
OpenAccessRuntime.metadata.parser.MetaDataParser.parse(XmlNode mappingXmlNode, String name) +83 |
[OpenAccessException: : startElement] |
Telerik.OpenAccess.SPI.Backends.ThrowException(Exception e) +28 |
Telerik.OpenAccess.RT.ExceptionWrapper.Throw() +34 |
OpenAccessRuntime.metadata.parser.MetaDataParser.parse(XmlNode mappingXmlNode, String name) +184 |
Telerik.OpenAccess.RT.DatabaseAdapter.ConvertMappingXmlNodes2JdoRoots(ArrayList mappingXmlNodes, ArrayList mappingSources, ArrayList jdoRootsArrayList) +283 |
Telerik.OpenAccess.RT.DatabaseAdapter.GetConfigProperties(ConfigManager configManager, String _url, String user, String password, String connectionId, ArrayList jdoRootsArrayList) +297 |
Telerik.OpenAccess.RT.DatabaseAdapter.AssertPersistenceManagerFactory(String usr, String password, Boolean open) +431 |
Telerik.OpenAccess.RT.DatabaseAdapter.GetObjectScope(TransactionProvider provider) +65 |
Telerik.OpenAccess.RT.DatabaseAdapter.GetObjectScope() +37 |
Telerik.OpenAccess.Database.GetObjectScope() +34 |
TestProject.Services.Authentication.AuthenticationService.DoesUserAuthenticate(String email, String password) in C:\Projects\TstProject\TestProject\TestProject.Services\Authentication\AuthenticationService.cs:14 |
TestProject.MVC.Web.Controllers.AccountController.Login(String email, String password, Boolean rememberMe) in C:\Projects\TstProject\TestProject\TestProject.MVC.Web\App\Controllers\AccountController.cs:36 |
lambda_method(ExecutionScope , ControllerBase , Object[] ) +262 |
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +51 |
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(MethodInfo methodInfo, IDictionary`2 parameters) +568 |
System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +117 |
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +305 |
System.Web.Mvc.<>c__DisplayClasse.<InvokeActionMethodWithFilters>b__b() +61 |
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +305 |
System.Web.Mvc.<>c__DisplayClasse.<InvokeActionMethodWithFilters>b__b() +61 |
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(MethodInfo methodInfo, IDictionary`2 parameters, IList`1 filters) +455 |
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +736 |
System.Web.Mvc.Controller.ExecuteCore() +180 |
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +96 |
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +36 |
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +377 |
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +71 |
System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +36 |
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181 |
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 |
-------------------------------------------------------------------------------- |
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 |
Can anyone assist me in what I am doing wrong? After the above method I woudl assume I delegate all the work to the Telerik ORM tool.
R.