Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I am new to SilverLight development, I need access SQL Database from my application for that I am using WCF service and it's working fine when I return a List type of a predefined class and properties.
But now I need data from a SQL Query and need to fill the DataGrid, the select columns in the query will vary based on the user selection, so I can not use a predefined class. I have tried adding the properties to the class at runtime using Reflections but of no use.
Please help me to solve this problem, if possible please explain with an example.

Thanks in advance.
Posted
Comments
AlexDpars 29-Nov-13 15:28pm    
Have a type with not all properties filled wouldn't be an option? Could you give us a sample of the table you are trying to retrieve data from? And also an example of what you are trying to achieve there?

1 solution

Have a look at below link. It has almost everything what you are trying to do.

http://stackoverflow.com/questions/17418528/bind-list-with-dynamically-returned-columns
 
Share this answer
 
Comments
pradeepgade 29-Nov-13 23:50pm    
Thanks I got the solution in the follwoing link
http://blogs.telerik.com/blogs/posts/10-01-22/how-to-serialize-your-datatable-to-silverlight-using-wcf-service.aspx
RaisKazi 30-Nov-13 13:27pm    
Perfect. Cheers!!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900