开发者

Operator '!=' cannot be applied [closed]

开发者 https://www.devze.com 2023-01-01 00:30 出处:网络
It's difficult to tell what is being asked here. This que开发者_高级运维stion is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form.
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

精彩评论

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

关注公众号