Using the "IsNothing" keyword - InfoPath Dev Sign in | Join | Help in Code InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Code » Using the "IsNothing" keyword Using the "IsNothing" keyword Last post 02-16-2007 12:07 PM by DuneBug. 5 replies. Page 1 of 1 (6 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 02-14-2007 09:25 AM snufse Joined on 02-01-2007 USA Posts 12 Using the "IsNothing" keyword Reply Contact I my code behind I am using the "IsNothing" keyword and it gives an error: "Name "IsnNothing" is not declared". Is this not supported by InfoPath through the programming interface????If Not IsNothing(MyDataSet) Then If MyDataSet.Tables("Table").Rows.Count > 0 Then myNav.SelectSingleNode("//my:name", Me.NamespaceManager). _ SetValue(MyDataSet.Tables("Table").Rows(0).Item(1)) myNav.SelectSingleNode("//my:department", Me.NamespaceManager). _ SetValue(MyDataSet.Tables("Table").Rows(0).Item(22)) End IfEnd If 02-14-2007 10:44 AM In reply to Patrick Halstead Joined on 08-07-2006 Posts 5,112 Re: Using the "IsNothing" keyword Mark as Not AnswerMark as Answer... Reply Contact Hi Rolf,What is "IsNothing"? Is this a built in function in VB.NET? If it is, it should be supported because InfoPath is .NET compatible. Patrick HalsteadProject Manager at Qdabra 02-15-2007 06:42 AM In reply to snufse Joined on 02-01-2007 USA Posts 12 Re: Using the "IsNothing" keyword Mark as Not AnswerMark as Answer... Reply Contact I have a windows app (code below) and works fine. In InfoPath 2007 gives me syntax error??????If Not IsNothing(MyDataSet) Then If MyDataSet.Tables("Table").Rows.Count > 0 Then TextBox1.Text = MyDataSet.Tables("Table").Rows(0).Item(1) TextBox2.Text = MyDataSet.Tables("Table").Rows(0).Item(22) End IfEnd IfAlso from MSDN HelpIsNothing returns True if the expression represents an object variable that currently has no object assigned to it; otherwise, it returns False.IsNothing is intended to work on reference types. A value type cannot hold a value of Nothing and reverts to its default value if you assign Nothing to it. If you supply a value type in Expression, IsNothing always returns False.ExampleThe following example uses the IsNothing function to determine if an object variable is associated with any object instance.Visual Basic Copy Code Dim testVar As Object' No instance has been assigned to variable testVar yet.Dim testCheck As Boolean' The following call returns True.testCheck = IsNothing(testVar)' Assign a string instance to variable testVar.testVar = "ABCDEF"' The following call returns False.testCheck = IsNothing(testVar)' Disassociate variable testVar from any instance.testVar = Nothing' The following call returns True.testCheck = IsNothing(testVar) 02-16-2007 12:58 AM In reply to Patrick Halstead Joined on 08-07-2006 Posts 5,112 Re: Using the "IsNothing" keyword Mark as Not AnswerMark as Answer... Reply Contact Hi Rolf, Sorry, but I don't know. Could be something to do with the limitations of the dataset. InfoPath supports them, but there are limitations. I don't have confidence that it is a dataset issue, though. Patrick HalsteadProject Manager at Qdabra 02-16-2007 05:30 AM In reply to snufse Joined on 02-01-2007 USA Posts 12 Re: Using the "IsNothing" keyword Mark as Not AnswerMark as Answer... Reply Contact Patrick:Is there a way to ask Microsoft? Do you have a reference site I could use? Thanks. 02-16-2007 12:07 PM In reply to DuneBug Joined on 12-14-2006 USA Posts 6 Re: Using the "IsNothing" keyword Mark as Not AnswerMark as Answer... Reply Contact I don't know what coding interface you are using (VB.net or the built-in infopath script.you might try this:dim obj as objectif not obj is nothing then ' do blahend if"Is" is the comparison operator for reference types. Using it is the same thing as saying "if obj = nothing" except since obj and nothing are both reference types the "=" and "<>" operators won't work.Give it a shot, I hope it works. If it doesn't oh well, i gave it the old college try. Page 1 of 1 (6 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.