Thanks for Gon. I've changed the code. But the problem is always the same. Here
is the stack trace(sorry, it's a frech Visual Studio)
L'exception System.MethodAccessException n'a pas été gérée
Message="PersoIBatis.Person..ctor()"
Source="IBatisNet.Common"
StackTrace:
à CreateImplementation(Object[] )
à
IBatisNet.Common.Utilities.Objects.DelegateFactory.Create.Invoke(Object[]
parameters)
à
IBatisNet.Common.Utilities.Objects.DelegateFactory.CreateInstance(Object[]
parameters)
à
IBatisNet.DataMapper.Configuration.ResultMapping.ResultMap.CreateInstanceOfResult(Object[]
parameters)
à
IBatisNet.DataMapper.MappedStatements.ResultStrategy.ResultMapStrategy.Process(RequestScope
request, IDataReader& reader, Object resultObject)
à
IBatisNet.DataMapper.MappedStatements.ResultStrategy.MapStrategy.Process(RequestScope
request, IDataReader& reader, Object resultObject)
à
IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForObject(RequestScope
request, ISqlMapSession session, Object parameterObject, Object resultObject)
à
IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObject(ISqlMapSession
session, Object parameterObject, Object resultObject)
à
IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObject(ISqlMapSession
session, Object parameterObject)
à IBatisNet.DataMapper.SqlMapper.QueryForObject(String statementName,
Object parameterObject)
à PersoIBatis.Program.Main(String[] args) dans D:\z.wang\Mes
documents\IBatis\PersoIBatis\PersoIBatis\Program.cs:ligne 17
à System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
à System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
assemblySecurity, String[] args)
à Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
à System.Threading.ThreadHelper.ThreadStart_Context(Object state)
à System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
à System.Threading.ThreadHelper.ThreadStart()
And the problem of property, there isn't someway I can write into the field
directly?Because, in the getter and setter I have some test like notnull, I
don't want to do the test for the data from the data base.
Thank you