locked
Creating objects from xml datatypes from sql table RRS feed

  • Question

  • Hello,

          I am using EF 4.1 and looking for methods/steps by which I can create objects from sql tables.

        In my case I am having a table name Product which contains following fields

     

    ProductID

    Description

    UnitOfMeasurement

    GeneralProductDetails

     

         In above schema GeneralProductDetails is a xml datatype and need to convert to individual objects when instentiating from SQL to EF 4,1

     

    Is there any sample or walkthough demonstrating similar senario?

    Nilkanth Desai

     

    Monday, August 22, 2011 11:47 PM

Answers

  • Hi Nilkanth,

    Welcome!

    I think the way to handle this scenario is return the XML type columns contents as String type, then Convert the strings to XML.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Alan_chen Thursday, September 1, 2011 6:33 AM
    Tuesday, August 23, 2011 8:58 AM

All replies

  • Hi Nilkanth,

    Welcome!

    I think the way to handle this scenario is return the XML type columns contents as String type, then Convert the strings to XML.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Alan_chen Thursday, September 1, 2011 6:33 AM
    Tuesday, August 23, 2011 8:58 AM
  • Hi,

    I am writing to check the status of the issue on your side. Would you mind letting us know the result of the suggestions?

    If you need further assistance, please feel free to let me know. I will be more than happy to be of assistance.

    Have a nice day. 


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, August 30, 2011 7:30 AM
  • Hello Alen,

         I am still not getting any result related to this question. It would be better If I get any HOL or walkthough samples which demonstrate inserting , retriving and updating xml fields with untyped/typed xml schema to a C# client (any web/windows) It would be helpful

     

    Thanks,

     

    Nilkanth Desai

     

     

    Monday, September 5, 2011 11:15 PM
  • Hi Nikanth,

    Thanks for your feedback.

    I think you can refer this link here: http://social.msdn.microsoft.com/Forums/en-NZ/adodotnetentityframework/thread/2d6b75ee-a1b7-44bf-b5f3-d32b12f2db66

    @Michael give a good reply.

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, September 6, 2011 9:22 AM