Operator '!=' cannot be applied [closed]
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'
精彩评论