XDocument reference missing

  • Thread starter ana9 via DotNetMonster.com
  • Start date

A

ana9 via DotNetMonster.com

I'm trying to use XDocument to reference an InfoPath form and I get the error
"The type or namespace name XDocument could not be found"

I have the following:
using Microsoft.Office.Infopath
using System
using System.Data
using System.Data.SqlClient
using System.Xml
using System.Xml.XPath

and References:
Microsoft.Office.Infopath
Microsoft.VisualStudio.Tools.Applications.Adapter
Microsoft.VisualStudio.Tools.Applications.Contract
System
System.AddIn.Contract
System.Data
System.Xml

Am I missing a reference or using directive?
 
Ad

Advertisements

M

Martin Honnen

ana9 said:
I'm trying to use XDocument to reference an InfoPath form and I get the error
"The type or namespace name XDocument could not be found"

I have the following:
using Microsoft.Office.Infopath
using System
using System.Data
using System.Data.SqlClient
using System.Xml
using System.Xml.XPath

You need
using System.Xml.Linq;
and a reference to System.Xml.Linq.dll.
 
W

Willy Denoyette [MVP]

ana9 via DotNetMonster.com said:
I'm trying to use XDocument to reference an InfoPath form and I get the
error
"The type or namespace name XDocument could not be found"

I have the following:
using Microsoft.Office.Infopath
using System
using System.Data
using System.Data.SqlClient
using System.Xml
using System.Xml.XPath

and References:
Microsoft.Office.Infopath
Microsoft.VisualStudio.Tools.Applications.Adapter
Microsoft.VisualStudio.Tools.Applications.Contract
System
System.AddIn.Contract
System.Data
System.Xml

Am I missing a reference or using directive?


namespace Microsoft.Office.Interop.Infopath assembly reference
Microsoft.Office.Interop.Infopath.dll

Willy.
 
A

ana9 via DotNetMonster.com

Thanks for the quick response Willy. After adding the IPeditor.dll ( which
apparently contains microsoft.office.interop.infopath.dll) I'm no longer
getting that error. Now I get an error on the line

thisXDocument.DOM.selectSingleNode("/my:myFields/my:field1").text = DS.Tables
[0].Rows[1][1].ToString();

The error is:
The type 'Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMDocument' is defined
in an assembly that is not referenced. You must add a reference to assembly
'Microsoft.Office.Interop.InfoPath.Xml'

and

'Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMDocument' does not contain a
definition for 'selectSingleNode'

I'm trying to follow the tutorial at
http://www.sharepointblogs.com/ssa/...-fields-with-sql-data-using-managed-code.aspx


Any further suggestions you have to offer are appreciated.

Thanks again.
I'm trying to use XDocument to reference an InfoPath form and I get the
error
[quoted text clipped - 18 lines]
Am I missing a reference or using directive?

namespace Microsoft.Office.Interop.Infopath assembly reference
Microsoft.Office.Interop.Infopath.dll

Willy.
 
Ad

Advertisements

A

ana9 via DotNetMonster.com

Disregard the previous post. It's simple enough to add a reference...

Thanks again for both of your help!
Thanks for the quick response Willy. After adding the IPeditor.dll ( which
apparently contains microsoft.office.interop.infopath.dll) I'm no longer
getting that error. Now I get an error on the line

thisXDocument.DOM.selectSingleNode("/my:myFields/my:field1").text = DS.Tables
[0].Rows[1][1].ToString();

The error is:
The type 'Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMDocument' is defined
in an assembly that is not referenced. You must add a reference to assembly
'Microsoft.Office.Interop.InfoPath.Xml'

and

'Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMDocument' does not contain a
definition for 'selectSingleNode'

I'm trying to follow the tutorial at
http://www.sharepointblogs.com/ssa/...-fields-with-sql-data-using-managed-code.aspx

Any further suggestions you have to offer are appreciated.

Thanks again.
[quoted text clipped - 6 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top