开发者

Operator '!=' cannot be applied [closed]

It's difficult to tell what is being asked here. This que开发者_高级运维stion is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 12 years ago.

when i try to create this check condition

if (dtimg != "")

{ // }

it show following error

Error 4 Operator '!=' cannot be applied to operands of type 'System.Data.DataTable' and 'string' E:\user\Mohsin.Malik\Project\FlagProperties\code\FlagProperties\Pages\FraturePropertyDetail.aspx.cs 104 13 http://localhost/FlagProperties/


dtimg is a DataTable... and "" is a String.

You can't compare a DataTable with string. Maybe you want to check for null?

if (dtimg != null) { // do something }


It means that you are comparing a DataTable to a string, which is illegal in most countries.

What are you trying to do? Null check? In that case, you should use

if (dtimg != null)


You got the answer right there:

Operator '!=' cannot be applied to operands of type 'System.Data.DataTable' and 'string'

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜