指定演员表无效。 [英] Specified cast is not valid.

查看:100
本文介绍了指定演员表无效。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


描述:执行

当前网络请求时发生了未处理的异常。请查看堆栈跟踪以获取更多信息

有关错误及其在代码中的起源。


异常详细信息:System.InvalidCastException:指定的强制转换不是有效。

第176行。


来源错误:

第174行:

第175行:

第176行:DataRowView drv =(DataRowView)e.Item.DataItem;

第177行:

第178行:System.Web.UI .WebControls.Image thumb =

(System.Web.UI.WebControls.Image)e.Item.FindControl(" thumbnail");

有人能帮帮我吗?


谢谢!

Hello,

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: System.InvalidCastException: Specified cast is not valid.
Line 176.

Source Error:
Line 174:
Line 175:
Line 176: DataRowView drv = (DataRowView) e.Item.DataItem;
Line 177:
Line 178: System.Web.UI.WebControls.Image thumb =
(System.Web.UI.WebControls.Image) e.Item.FindControl("thumbnail");
Can somebody help me?

Thanks!

推荐答案

你正在施放一个DataItem。作为DataRowView - 那是一个无效的演员!!

呵呵 - 我知道我听起来像你的错误,但这是真的。你不能假装

DataItem是一个DataRowView ..


" Arjen" <博***** @ hotmail.com>在消息中写道

news:bh ********** @ news1.tilbu1.nb.home.nl ...
You''re casting a "DataItem" as a "DataRowView" - that''s an invalid cast!!
hehehe - I know I sound like your error, but it''s true. You can''t pretend a
DataItem is a DataRowView..

"Arjen" <bo*****@hotmail.com> wrote in message
news:bh**********@news1.tilbu1.nb.home.nl...
你好,

描述:执行
当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取更多信息
有关错误及其在代码中的起源。

异常详细信息:System.InvalidCastException:指定的强制转换不是
有效。第176行。

来源错误:

第174行:
第175行:
第176行:DataRowView drv =(DataRowView)e.Item.DataItem ;第177行:
第178行:System.Web.UI.WebControls.Image thumb =
(System.Web.UI.WebControls.Image)e.Item.FindControl(" thumbnail" ;);

有人能帮助我吗?

谢谢!
Hello,

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: System.InvalidCastException: Specified cast is not valid. Line 176.

Source Error:
Line 174:
Line 175:
Line 176: DataRowView drv = (DataRowView) e.Item.DataItem;
Line 177:
Line 178: System.Web.UI.WebControls.Image thumb =
(System.Web.UI.WebControls.Image) e.Item.FindControl("thumbnail");
Can somebody help me?

Thanks!



和现在?


" Frank Drebin" <无***** @ imsickofspam.com> schreef在bericht

新闻:eU ********************** @ newssvr28.news.prodi gy.com ...
And now?

"Frank Drebin" <no*****@imsickofspam.com> schreef in bericht
news:eU**********************@newssvr28.news.prodi gy.com...
你正在施放一个DataItem。作为DataRowView - 那是一个无效的演员!!
呵呵 - 我知道我听起来像你的错误,但这是真的。你不能假装
DataItem是一个DataRowView ..

Arjen <博***** @ hotmail.com>在消息中写道
新闻:bh ********** @ news1.tilbu1.nb.home.nl ...
You''re casting a "DataItem" as a "DataRowView" - that''s an invalid cast!!
hehehe - I know I sound like your error, but it''s true. You can''t pretend a DataItem is a DataRowView..

"Arjen" <bo*****@hotmail.com> wrote in message
news:bh**********@news1.tilbu1.nb.home.nl...
你好,
描述:执行
当前Web请求期间发生了未处理的异常。请查看堆栈跟踪以获取更多信息
有关错误及其在代码中的起源。

异常详细信息:System.InvalidCastException:指定的强制转换不是
Hello,

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: System.InvalidCastException: Specified cast is not


有效。

第176行。

来源错误:

第174行:
第175行:
第176行:DataRowView drv =(DataRowView)e.Item.DataItem;
第177行:
第178行:System.Web.UI.WebControls.Image thumb =
(System.Web.UI.WebControls.Image )e.Item.FindControl(" thumbnail");

有人可以帮帮我吗?

谢谢!
Line 176.

Source Error:
Line 174:
Line 175:
Line 176: DataRowView drv = (DataRowView) e.Item.DataItem;
Line 177:
Line 178: System.Web.UI.WebControls.Image thumb =
(System.Web.UI.WebControls.Image) e.Item.FindControl("thumbnail");
Can somebody help me?

Thanks!






现在,你仍然不能。你只能强迫变量假装它是一个不同类型的b
当它们足够接近时......


以同样的方式你不能''做到这一点:


TreeView objMyTree =(TreeView)strSomeString;


你不能把那些差别很大的东西扔掉。没有办法强制使用

字符串来表示TreeView。


Arjen <博***** @ hotmail.com>在消息中写道

news:bh ********** @ news1.tilbu1.nb.home.nl ...

And now, you still can''t. You can only coerce a variable to pretend it''s a
different type - when they are close enough..

In the same way you couldn''t do this:

TreeView objMyTree = (TreeView)strSomeString;

You can''t cast things that are vastly different. There is no way to coerce a
string into representing a TreeView.

"Arjen" <bo*****@hotmail.com> wrote in message
news:bh**********@news1.tilbu1.nb.home.nl...
现在?


" Frank Drebin" <无***** @ imsickofspam.com> schreef in bericht
新闻:eU ********************** @ newssvr28.news.prodi gy.com ...
And now?

"Frank Drebin" <no*****@imsickofspam.com> schreef in bericht
news:eU**********************@newssvr28.news.prodi gy.com...
你正在投射一个DataItem。作为DataRowView - 这是一个无效的
演员!呵呵呵 - 我知道我听起来像你的错误,但这是真的。你不能
You''re casting a "DataItem" as a "DataRowView" - that''s an invalid cast!! hehehe - I know I sound like your error, but it''s true. You can''t


假装

DataItem是一个DataRowView ..

Arjen <博***** @ hotmail.com>在消息中写道
新闻:bh ********** @ news1.tilbu1.nb.home.nl ...
DataItem is a DataRowView..

"Arjen" <bo*****@hotmail.com> wrote in message
news:bh**********@news1.tilbu1.nb.home.nl...
你好,
描述:当前Web请求执行
期间发生未处理的异常。请查看堆栈跟踪,了解有关错误及其源自代码的更多
信息。

异常详细信息:System.InvalidCastException:指定的强制转换不是
Hello,

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: System.InvalidCastException: Specified cast is not


有效。

第176行。

来源错误:

第174行:
第175行:
第176行:DataRowView drv =(DataRowView)e.Item.DataItem;
第177行:
第178行:System.Web.UI.WebControls.Image thumb =
(System.Web.UI.WebControls.Image )e.Item.FindControl(" thumbnail");

有人可以帮帮我吗?

谢谢!
Line 176.

Source Error:
Line 174:
Line 175:
Line 176: DataRowView drv = (DataRowView) e.Item.DataItem;
Line 177:
Line 178: System.Web.UI.WebControls.Image thumb =
(System.Web.UI.WebControls.Image) e.Item.FindControl("thumbnail");
Can somebody help me?

Thanks!





这篇关于指定演员表无效。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆