1

I want to retrieve the XML data from SQL Server database and bound it to the DropDownList using LINQ query on C#.

XML field in clients table:

<root>
  <clientname>andrew</clientname> --  dropdownlist text field
  <clientid>1</clientid>          -- dropdownlist value field
  <clientname>jim</clientname>
  <clientid>2</clientid>
  <clientname>john</clientname>
  <clientid>3</clientid>
  <clientname>johnson</clientname>
  <clientid>4<clientid>
</root>

do you have any idea?

0

2 Answers 2

1

LINQ (presumably meaning LINQ-to-SQL or EF) doesn't currently have any special treatment of the XML data-type. You'll need to fetch it back as normal, then load it into a DOM and handle from there. Perhaps looking at the question: how to load xml file into dropdownlist in asp.net

Sign up to request clarification or add additional context in comments.

Comments

0

It is not clear why you store list of entities as one value. Try to normalize your DB model.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.