Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Entity Framework for a stored procedure that returns results of an XPath query on XML data.

Posted on 2009-05-01
1
Medium Priority
?
874 Views
Last Modified: 2012-05-06
I have a stored procedure that returns XML column elements and attributes for a user-specified row in a SQL Table as a row.

Since this sql stored procedure returns a single row containing data from a XML column - (and the columns of this row are not defined by an existing SQL Table or view) - what return type should be specified for the EDMX Function Import?


ALTER PROCEDURE [dbo].[GetXmlData]
	@GuidOfInterest uniqueidentifier
 
declare @XmlCol as xml;							
select @XmlCol = XmlTableCol from dbo.TableWithXmlCol
	    where UniqueGuid = @GuidOfInterest
	
select @XmlCol.value('(//Root/@RootName)[1]', 'char(38)' ) as RootName,
          @XmlCol.value('(//Root/@RootGUID)[1]', 'char(38)' ) as RootGuid,
          @XmlCol.value('(//Root/SetupName)[1]', 'char(80)') as SetupName

Open in new window

0
Comment
Question by:MDKIMZEY
1 Comment
 

Accepted Solution

by:
MDKIMZEY earned 0 total points
ID: 24295674
There probably is a way to call a stored procedure that returns the result of an XPath query on XML data in a SQL table using Entity Framework - but I have not found it.
For this case, as well as stored procedures that use the PIVOT command, I had to use straight ADO.net.  ADO.net calls were successful.
 
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question