from vb to c# not working - InfoPath Dev
in

InfoPath Dev

from vb to c# not working

Last post 02-23-2010 12:06 PM by barmatt80. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 02-22-2010 08:37 PM

    from vb to c# not working

    using infopath 2007

     i have the following in vb and works fine:

    DataSources("external datasource name").CreateNavigator().SelectSingleNode("xpath to field in external datasource", NamespaceManager).SetValue(Application.User.LoginName)

    however when putting that in c# we get this error

    'Microsoft.Office.InfoPath.XmlFormHostItem.DataSources' is a 'property' but is used like a 'method'

     what should it be in c#?  i can't figure that out and the converter i use says the c# is the same as vb

     

    Thanks

  • 02-22-2010 08:42 PM In reply to

    Re: from vb to c# not working

     In C#, indexers are accessed with square brackets, not parentheses:

     DataSources["external datasource name"].CreateNavigator().SelectSingleNode("xpath to field in external datasource", NamespaceManager).SetValue(Application.User.LoginName);

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 02-23-2010 12:06 PM In reply to

    Re: from vb to c# not working

    thanks!  i figured it had to be something simple.  i got it to work on another form and i'll pass it to our guy to implement it.

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.