if (node.Attributes != null) //checking for attributes of a xml file node.
views:
180answers:
4
+2
A:
if (node.Attributes != null)
Edit:
you have edit your question VB.Net Equilent code..
If node.Attributes IsNot Nothing Then
Muhammad Akhtar
2009-12-16 11:35:01
He _did_ tag it with VB.NET... should have been a clue :)
Oded
2009-12-16 11:50:43
It's not the right syntax... Nicky Waites has posted the right syntax (IsNot)
Meta-Knight
2009-12-16 14:03:08
+3
A:
I am assuming you are looking for the equivelant in VB.NET:
If node.Attributes Is Not Nothing Then
Oded
2009-12-16 11:45:05
Actually I just tested it in the IDE and Is Not Nothing doesn't work...
Meta-Knight
2009-12-16 14:01:06
With VB2005 we got the "IsNot" keyword. Previously we had to use the more awkward syntax of "If Not obj Is Nothing Then"
Chris Haas
2009-12-16 14:23:29
is this If node.Attributes Is Not Nothing Then return something different ?
Muhammad Akhtar
2009-12-16 12:00:47
I prefer IsNot Nothing which is more intuitive than Not ... Is Nothing, but it does work.
Meta-Knight
2009-12-16 13:08:32
..though as noted by Chris Haas, in VS2003, it's the only alternative.
Meta-Knight
2009-12-16 15:16:44
+1
A:
I find charp-to-vb a great site for converting between c# and vb.net
In this case
If node.Attributes IsNot Nothing Then
End If
Nicky Waites
2009-12-16 12:15:31
Can you explain why you think there is an error? If it is the End If then fair enough since you wont need that with a single statement.
Nicky Waites
2009-12-17 09:40:36