9

How to use XQuery expression on XMLDocument or XDocument?

Is it possible to use XQuery in C#?

ARZ
  • 2,461
  • 3
  • 34
  • 56
  • Why would you want to do that? – svick Feb 07 '12 at 13:02
  • I have a function in sql that do some work on xml using XQuery. I need to insert some data that returned by this function from c# to a sql table and for this I must first, connect and execute this function from c# and then insert this data using Entity framework to sql but I want to connect just one time if it's possible & run the function in C# then connect to insert the result to sql! – ARZ Feb 07 '12 at 13:50

2 Answers2

5

Sure there are a number of XQuery processors that run in .NET, for example XQSharp and Saxon.

Michael Kay
  • 156,231
  • 11
  • 92
  • 164
2

Just refer this Xquery in .NET

Smack
  • 936
  • 1
  • 13
  • 31