Last post May 23, 2013 04:21 PM by Rajneesh Verma
Member
6 Points
40 Posts
May 23, 2013 04:00 PM|Guzar|LINK
Hello,
If (DataBinder.Eval(e.Item.DataItem, "value") <> DBNull.Value) Then some conversion End If
Operator '<>' is not defined for types 'Object' and 'System.DBNull'
Could you give me any solution with this ?
Thanks
Star
13450 Points
2764 Posts
May 23, 2013 04:15 PM|Nasser Malik|LINK
I am not a vb guy but i suggest you if it isn't working than you can compare like
If Not String.IsNullOrEmpty(Convert.ToString(DataBinder.Eval(e.Item.DataItem, "value"))) Then End If
Regards.
May 23, 2013 04:20 PM|Guzar|LINK
Cool its working, thanks for fast answer.
All-Star
28988 Points
7251 Posts
May 23, 2013 04:21 PM|Rajneesh Verma|LINK
You can use IIf for better performace, See:
IIf(IsDBNull(DataBinder.Eval(e.Item.DataItem, "value")) OrElse _ String.IsNullOrEmpty(DataBinder.Eval(e.Item.DataItem, "value")), "", "some(Conversion)")
Member
6 Points
40 Posts
Convert DataBinder.Eval
May 23, 2013 04:00 PM|Guzar|LINK
Hello,
Operator '<>' is not defined for types 'Object' and 'System.DBNull'
Could you give me any solution with this ?
Thanks
Star
13450 Points
2764 Posts
Re: Convert DataBinder.Eval
May 23, 2013 04:15 PM|Nasser Malik|LINK
I am not a vb guy but i suggest you if it isn't working than you can compare like
Regards.
Skype: maleknasser1
LinkedIn: https://www.linkedin.com/in/maliknasser
Member
6 Points
40 Posts
Re: Convert DataBinder.Eval
May 23, 2013 04:20 PM|Guzar|LINK
Cool its working, thanks for fast answer.
All-Star
28988 Points
7251 Posts
Re: Convert DataBinder.Eval
May 23, 2013 04:21 PM|Rajneesh Verma|LINK
You can use IIf for better performace, See:
www.rajneeshverma.com