Last post Sep 19, 2011 03:13 AM by Anand Mani Tiwari
Sep 13, 2011 12:53 AM|lgarciap|LINK
I hope you can help me with this. I'm using linq with dynamic data. I need that the datagrid of a custom list template show data of two tables. I tried with an extended query but I get an error. How can I do that??
thanks in advanced
Sep 13, 2011 01:01 AM|chiragvidani|LINK
You cannot do this directly. But indirectly by applying logic its possible. You need to combine the data of both table in list (generic list of custom type entity).
Now bind this list to datagrid.
Sep 13, 2011 05:12 AM|sjnaughton|LINK
The only way to do thi sin Dynamic Data with .Nt 4 is to use a view and if you want the data to be updateable then you will need to use some SROCS
Sep 14, 2011 05:23 AM|jeet.patel|LINK
you have to join both table in linq and perform your operation, you can get out put in list or array use of extension method(linq query) and result directly bind it to your datagrid.
Sep 14, 2011 07:56 AM|sjnaughton|LINK
Hi jeet.patel this will nto work in a Dynamic Data application as it does no support data shaping.
Sep 14, 2011 02:42 PM|konanki|LINK
check below links
Sep 14, 2011 08:37 PM|pratiksolanki|LINK
I assume you use Dynamic Data 4.0. If you use SQL Server DB then design database diagram, setup proper relationship. then call/connect database to visual studio project (obviously on ".edmx" file) run your project, if you have define proper relationship
then you will get more than two joined tables on gridview without writing single line of code.
There is another way to do the same; if you have certain business logic or complex output to show on gridview then create view using your query and as mentioned above by "sjnaughton"
you can call you "View" on ".edmx" or ".dbml" (I am not sure about .dbml provides or not). and You always write your custom saving process for Insert, Update for this view.
Well as per microsoft's documentaion the latest version 4.0 and above of "ADO.Net Entity Framework i.e. .edmx" is much powerfull then the LINQ To SQL as "ADO.Net Entity Framework" inludes LINQ as well.
There are many article to run customise saving/update process.
Sep 15, 2011 12:15 AM|lgarciap|LINK
Thank you all. I crated a view and now I going to customize insert, update and delete code. I'm new in dynamic data and now I'm going to look for documentation of how to do it.
Sep 16, 2011 02:23 AM|lgarciap|LINK
I've created a view and I tried to update a field through my view and everything were fine. When I want to enable, Edit and Delete links in my List.aspx I got the following error:
CS1061: 'ASP.dynamicdata_custompages_users_list_aspx' does not contain a definition for 'GridView1_SelectedIndexChanged' and no extension method 'GridView1_SelectedIndexChanged' accepting a first argument of type 'ASP.dynamicdata_custompages_users_list_aspx'
could be found (are you missing a using directive or an assembly reference?)
I have to program that method?
Sep 16, 2011 03:47 AM|sjnaughton|LINK
see Rick Anderson's article here
How to create an updateable view with ADO Entity Framework and with LINQ to SQL I personally do the insert using SPROCS, although there is an issue with this in EF at the moment L2S works fine though.
Sep 16, 2011 01:07 PM|lgarciap|LINK
Thank you sjnaughton. I followed the link but is not available. Do you know another similar link? I really need it.
Sep 16, 2011 01:15 PM|sjnaughton|LINK
Just fixed it the Editor here somtimes thinks a URL is relative to this site and makes it relative
I just fixed it and tested
Sep 17, 2011 01:01 AM|lgarciap|LINK
Now I can see insert, update, delete and details links, but when I try to update I get an SQL exception because the action involve more than one table, I have the stored procedures working, How I can tell dynamic data to use my stored procedures??
Sep 17, 2011 01:10 AM|navneetmitawa|LINK
hi try this..
Sep 19, 2011 03:11 AM|lgarciap|LINK
thank you. Using SPROCS I can insert in my view.
Sep 19, 2011 03:13 AM|Anand Mani Tiwari|LINK
Please go to the below link, here you will find the exact answer.