| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1233 人关注过本帖
标题:对象不能从 DBNull 转换为其他类型
只看楼主 加入收藏
keshunping
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-9-28
收藏
 问题点数:0 回复次数:2 
对象不能从 DBNull 转换为其他类型
行 89:     protected void btn_save_edit_Command(object sender, CommandEventArgs e)
行 90:     {
行 91:         FormView1.UpdateItem(true);
行 92:         //FormView1.DataBind();
行 93:         WebClass.Script.Alert("修改成功!");
 

源文件: d:\桌面\新建文件夹\xugu\stu.aspx.cs    行: 91

堆栈跟踪:


[InvalidCastException: 对象不能从 DBNull 转换为其他类型。]
   System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider) +54
   System.Convert.ChangeType(Object value, TypeCode typeCode, IFormatProvider provider) +293
   System.Web.UI.WebControls.Parameter.GetValue(Object value, String defaultValue, TypeCode type, Boolean convertEmptyStringToNull, Boolean ignoreNullableTypeChanges) +248
   System.Web.UI.WebControls.SqlDataSourceView.AddParameters(DbCommand command, ParameterCollection reference, IDictionary parameters, IDictionary exclusionList, String oldValuesParameterFormatString) +547
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues) +413
   System.Web.UI.DataSourceView.Update(IDictionary keys, IDictionary values, IDictionary oldValues, DataSourceViewOperationCallback callback) +78
   System.Web.UI.WebControls.FormView.HandleUpdate(String commandArg, Boolean causesValidation) +1151
   System.Web.UI.WebControls.FormView.UpdateItem(Boolean causesValidation) +19
   stu.btn_save_edit_Command(Object sender, CommandEventArgs e) in d:\桌面\新建文件夹\xugu\stu.aspx.cs:91
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +75
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4921

 


--------------------------------------------------------------------------------
搜索更多相关主题的帖子: DBNull 对象 类型 
2008-09-28 17:06
keshunping
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-9-28
收藏
得分:0 
那位兄台帮帮忙啊,急啊!
2008-09-28 17:07
hw1024
Rank: 1
等 级:新手上路
帖 子:35
专家分:0
注 册:2008-3-11
收藏
得分:0 
有空值哎~

C#, Web开发,javascript、Ajax群:64913828
2008-09-30 16:33
快速回复:对象不能从 DBNull 转换为其他类型
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017198 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved