问题描述
工程文件:http://mail.qq.com/cgi-bin/ftnExs_download?k=70396163dc68d89e7c8ed6624439034e025b575b070f5553190e07525b140500555b4c5b520e044c005b5655045f0050500f58056229312c5d4a3106104a5e0f5a5c0d4d10584361&t=exs_ftn_download&code=49acb91a(提取码49acb91a)分不多了,好像只有10分了,拜托,谢谢大家了。。。谢谢大家关注,我是初学做B/S模式的开发,想先找到一个较大的例子通过后,再详细看书,但是现在出现了这个问题:按照MIS系统开发与应用(ASP.NET+SQLSERVER2000版)给出的步骤做,已经可以连接数据库并登录,但是网页左边的树形选择去无法出现。已经将webcontrols控件放在了IIS主目录和虚拟目录下(因为不懂,为保险起见也放了一个),放的路径肯定没问题,已经搜过无数帖子了,但现在就出现以下提示:请问有人知道问题出在哪儿吗?谢谢了ServerErrorin'/MisPersonnel'Application.--------------------------------------------------------------------------------TypeofvaluehasamismatchwithcolumntypeDescription:Anunhandledexceptionoccurredduringtheexecutionofthecurrentwebrequest.Pleasereviewthestacktraceformoreinformationabouttheerrorandwhereitoriginatedinthecode.ExceptionDetails:System.ArgumentException:TypeofvaluehasamismatchwithcolumntypeSourceError:Anunhandledexceptionwasgeneratedduringtheexecutionofthecurrentwebrequest.Informationregardingtheoriginandlocationoftheexceptioncanbeidentifiedusingtheexceptionstacktracebelow.StackTrace:[ArgumentException:Typeofvaluehasamismatchwithcolumntype]System.Data.Common.ObjectStorage.Set(Int32recordNo,Objectvalue)+955System.Data.DataColumn.set_Item(Int32record,Objectvalue)+37[ArgumentException:TypeofvaluehasamismatchwithcolumntypeCouldn'tstore<0>inTreeIDColumn.ExpectedtypeisDataRow.]System.Data.DataColumn.set_Item(Int32record,Objectvalue)+72System.Data.DataRow.set_Item(DataColumncolumn,Objectvalue)+194System.Data.DataRow.set_Item(Int32columnIndex,Objectvalue)+25SQLHelper.SystemTools.ConvertDataReaderToDataTable(SqlDataReaderdataReader)+468[Exception:TypeofvaluehasamismatchwithcolumntypeCouldn'tstore<0>inTreeIDColumn.ExpectedtypeisDataRow.]SQLHelper.SystemTools.ConvertDataReaderToDataTable(SqlDataReaderdataReader)+635MisPersonnel.Components.Tree.GetTrees(StringsProName)inD:ASP.NETMISMisPersonnelComponentsTree.cs:81MisPersonnel.Components.Tree.BindTree(TreeViewtreeView)inD:ASP.NETMISMisPersonnelComponentsTree.cs:19MisPersonnel.DesktopModules.LeftTree.BindTreeData()inD:ASP.NETMISMisPersonnelDesktopModulesLeftTree.aspx.cs:35MisPersonnel.DesktopModules.LeftTree.Page_Load(Objectsender,EventArgse)inD:ASP.NETMISMisPersonnelDesktopModulesLeftTree.aspx.cs:28System.Web.UI.Control.OnLoad(EventArgse)+98System.Web.UI.Control.LoadRecursive()+71System.Web.UI.Page.ProcessRequestMain(BooleanincludeStagesBeforeAsyncPoint,BooleanincludeStagesAfterAsyncPoint)+4315--------------------------------------------------------------------------------VersionInformation:Microsoft.NETFrameworkVersion:2.0.50727.42;ASP.NETVersion:2.0.50727.42
解决方案
解决方案二:
问题出在这里LeftTree.aspx.cs:35可能你给treeview的datasource和treeview能接受的datasource不匹配
解决方案三:
谢谢楼上的朋友,查看了一下,没查出来。。。