| 发表于:2007-02-05 16:42:554楼 得分:0 |
新问题如下:恕小弟愚笨,谁帮我看看,解决后追加分! -------------------------------------------------------------------------------- “/webview”应用程序中的服务器错误。 -------------------------------------------------------------------------------- 未将对象引用设置到对象的实例。 说明: 执行当前 web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: system.nullreferenceexception: 未将对象引用设置到对象的实例。 源错误: 行 22: private void list_load () 行 23: { 行 24: dglist.datasource = helpers.person().selectall(); 行 25: dglist.databind (); 行 26: } 源文件: d:\zyt_web\donet\tutorial\webview\forms\person.aspx.cs 行: 24 堆栈跟踪: [nullreferenceexception: 未将对象引用设置到对象的实例。] ibatisnet.datamapper.configuration.domsqlmapbuilder.parseglobalproperties() +96 ibatisnet.datamapper.configuration.domsqlmapbuilder.initialize() +258 ibatisnet.datamapper.configuration.domsqlmapbuilder.build(xmldocument document, datasource datasource, boolean useconfigfilewatcher, boolean iscallfromdao) +234 [configurationexception: - the error occurred while validate sqlmap config.] ibatisnet.datamapper.configuration.domsqlmapbuilder.build(xmldocument document, datasource datasource, boolean useconfigfilewatcher, boolean iscallfromdao) +288 ibatisnet.datamapper.configuration.domsqlmapbuilder.configureandwatch(string resource, configurehandler configuredelegate) +209 ibatisnet.datamapper.mapper.initmapper() +71 ibatisnet.datamapper.mapper.instance() +62 ibatistutorial.model.helper.mapper() +6 ibatistutorial.model.personhelper.selectall() +4 ibatistutorial.web.forms.personpage.list_load() in d:\zyt_web\donet\tutorial\webview\forms\person.aspx.cs:24 ibatistutorial.web.forms.personpage.page_load(object sender, eventargs e) in d:\zyt_web\donet\tutorial\webview\forms\person.aspx.cs:88 system.web.ui.control.onload(eventargs e) +80 system.web.ui.control.loadrecursive() +49 system.web.ui.page.processrequestmain(boolean includestagesbeforeasyncpoint, boolean includestagesafterasyncpoint) +3745 -------------------------------------------------------------------------------- 版本信息: microsoft .net framework 版本:2.0.50727.42; asp.net 版本:2.0.50727.42 --------------------------------------------------------------------------------- 配置文件: sqlmap.config 位于根目录 --------------------------------------------------------------------------------- <?xml version= "1.0 " encoding= "utf-8 " ?> <sqlmapconfig xmlns:xsi= "http://www.w3.org/2001/xmlschema-instance " xsi:nonamespaceschemalocation= "sqlmapconfig.xsd "> <properties resource= "properties.config "/> <settings> <setting usestatementnamespaces= "false "/> <setting cachemodelsenabled= "true "/> </settings> <database> <provider name= "${provider} "/> <datasource name= "ibatistutorial " connectionstring= "${connectionstring} "/> </database> <sqlmaps> <sqlmap resource= "${root}map/personhelper.xml "/> </sqlmaps> </sqlmapconfig> ------------------------------------------------------------------------------------ properties.config 位于根目录 ------------------------------------------------------------------------------------ <?xml version= "1.0 " encoding= "utf-8 " ?> <settings> <!-- user application and configured property settings go here.--> <!-- example: <add key= "settingname " value= "settingvalue "/> --> <add key= "provider " value= "oledb1.1 " /> <add key= "connectionstring " value= "provider=microsoft.jet.oledb.4.0;data source=data/ibatistutorial.mdb " /> <add key= "root " value= "./ " /> </settings> --------------------------------------------------------------------------------- personhelper.xml 位于根目录下 map文件夹 --------------------------------------------------------------------------------- <?xml version= "1.0 " encoding= "utf-8 " ?> <sqlmap namespace= "person " xmlns:xsi= "http://www.w3.org/2001/xmlschema-instance " xsi:nonamespaceschemalocation= "sqlmap.xsd "> <!-- xml "behind " document for the people service class. --> <alias> <typealias alias= "person " type= "ibatistutorial.model.person, ibatistutorial.model " /> </alias> <resultmaps> <resultmap id= "selectresult " class= "person "> <result property= "id " column= "per_id " /> <result property= "firstname " column= "per_first_name " /> <result property= "lastname " column= "per_last_name " /> <result property= "birthdate " column= "per_birth_date " /> <result property= "weightinkilograms " column= "per_weight_kg " /> <result property= "heightinmeters " column= "per_height_m " /> </resultmap> </resultmaps> <statements> <select id= "select " parameterclass= "int " resultmap= "selectresult "> select per_id, per_first_name, per_last_name, per_birth_date, per_weight_kg, per_height_m from person <dynamic prepend= "where "> <isparameterpresent> per_id = #value# </isparameterpresent> </dynamic> </select> <insert id= "insert " parameterclass= "person "> insert into person (per_id, per_first_name, per_last_name, per_birth_date, per_weight_kg, per_height_m) values (#id#, #firstname#, #lastname#, #birthdate#, #weightinkilograms#, #heightinmeters#) </insert> <update id= "update " parameterclass= "person "> update person set per_first_name = #firstname#, per_last_name = #lastname#, per_birth_date = #birthdate#, per_weight_kg = #weightinkilograms#, per_height_m = #heightinmeters# where per_id = #id# </update> <delete id= "delete " parameterclass= "int "> delete from person where per_id = #value# </delete> </statements> </sqlmap> ---------------------------------------------------------------------------------- | | |
|