Forum LINQ to SQL (Pre-Release)Discuss and ask questions about LINQ in Visual Studio 2010 Pre-Release Builds (CTPs/Betas)© 2009 Microsoft Corporation. Tous droits réservés.Tue, 24 Nov 2009 06:22:51 Zc027e83f-098b-43e7-b151-4c98e4d67935http://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/21052df8-08c8-4b92-81ea-dfe2d1749de8http://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/21052df8-08c8-4b92-81ea-dfe2d1749de8chandrashekhar.byreddyhttp://social.msdn.microsoft.com/Profile/fr-FR/?user=chandrashekhar.byreddyexception while loading xml document from physical locationI am getting an exception like this..Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. while loading from physical location from my system.I have given the security permission to the filder,file and also to the directory then also i am getting this error  <br/> <br/> <br/>  <strong>i have written like this.... XDocument xdoc=XDocument.Load(&quot;D:\\Xmlfiles\\programming.xml&quot;); </strong> <br/> <br/> <br/> my further code is.. var data = from dataa in xdoc.Descendants(&quot;story&quot;) where dataa.Element(&quot;thumbnail&quot;) != null &amp;&amp; dataa.Element(&quot;thumbnail&quot;).Attribute(&quot;src&quot;).Value.EndsWith(&quot;.png&quot;) select new UserData { Title = (string)dataa.Element(&quot;title&quot;).Value, ID = (int)dataa.Attribute(&quot;id&quot;), Src = (string)dataa.Element(&quot;thumbnail&quot;).Attribute(&quot;src&quot;).Value, UserName = (string)dataa.Element(&quot;user&quot;).Attribute(&quot;name&quot;).Value, Topic = (string)dataa.Element(&quot;topic&quot;).Attribute(&quot;name&quot;).Value, }; <br/>Thu, 05 Nov 2009 05:18:51 Z2009-11-11T02:02:38Zhttp://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/43249c18-6e4c-4afe-921a-59527905cf77http://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/43249c18-6e4c-4afe-921a-59527905cf77kainharthttp://social.msdn.microsoft.com/Profile/fr-FR/?user=kainhartIssue with use of constant expressions and use of Union or ConcatThere is a known issue with Union and Concat in LINQ to SQL where the use of the same constant value more than once will not produce the expected projection and cause the underlying SQL UNION command to fail. This has been explained as a consequence of early optimization by the query provider and according to <a href="http://social.msdn.microsoft.com/Forums/en-US/linqtosql/thread/3de28327-c8f9-4ef7-b690-64b22c66d3be">Damien Gaurd's thoughtful post</a> this is supposed to be addressed in LINQ to SQL within .NET 4.0. Unfortunately this has been contradicted on <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=355734">this post</a> (ID#355734) on the Microsoft Connect site where a member of the LINQ to SQL team reported &quot;we will not be fixing this in the next release of LINQ to SQL&quot;.<br/> <br/> Can we get some kind of confirmation on whether this will be addressed in .NET 4.0 and what time frame we are looking at until we will see it come through in public beta's or release candidates?<br/> <br/> My only workaround at this point is to use a let statement for every constant that I introduce into my projection for the sake of making my projections similar so that Union and Concat work. Now that I have more than 100 let statements in a particular query I have a feeling that this is contributing to other this other<a href="http://social.msdn.microsoft.com/Forums/en-US/linqtosql/thread/86cd891a-e25a-46b0-92d2-bf88f5c75a35"> scary TypeLoadException issue</a> that I have just recently began to run into. At this point this bug is affecting my ability to design what is otherwise an elegant data access layer.<br/> <br/>Thu, 10 Sep 2009 16:59:17 Z2009-10-07T23:57:41Zhttp://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/c354f12a-903c-4456-84b6-c04d5bb4b8ebhttp://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/c354f12a-903c-4456-84b6-c04d5bb4b8ebkainharthttp://social.msdn.microsoft.com/Profile/fr-FR/?user=kainhartIs the 2100 parameter limit when using IEnumerable.Contains() issue going to be addressedIs the 2100 parameter limit when using IEnumerable.Contains() issue going to be addressed in .NET 4.0?Thu, 10 Sep 2009 18:34:41 Z2009-09-20T05:04:33Zhttp://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/5286195d-5e2e-4246-abe8-78ed55716015http://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/5286195d-5e2e-4246-abe8-78ed55716015Kentlytears09http://social.msdn.microsoft.com/Profile/fr-FR/?user=Kentlytears09Add, Search, Update, Delete a RecordHello Everybody, I am new to vb.net, i want to Add, Search, Update, Delete a Record on a webserver, add button is to click for saving records, Search record using a Textbox to search, then Display the Data on a textbox or labelbox &quot;Not on a gridview&quot;. Update button to update the record as well as for delete button.. thanks in advance...Tue, 25 Aug 2009 06:31:07 Z2009-09-16T05:07:11Zhttp://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/11ecc15f-ccbb-4377-81c5-72628e2edec5http://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/11ecc15f-ccbb-4377-81c5-72628e2edec5Mihai Dinculescuhttp://social.msdn.microsoft.com/Profile/fr-FR/?user=Mihai%20DinculescuNo LINQ intellisense when targeting Framework 3.5Hello<br/><br/>I am getting no LINQ intellisense when my project is targeting the 3.5 framework. It compiles succesfully and runs but no intellisense at all on LINQ. When targeting framework 4.0 all is good.<br/><br/>Is there any fix for this?<br/><br/>Thanks,Sun, 31 May 2009 19:54:38 Z2009-09-10T13:34:34Zhttp://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/0e2fa724-7b71-401b-a659-86d91a000640http://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/0e2fa724-7b71-401b-a659-86d91a000640janvihttp://social.msdn.microsoft.com/Profile/fr-FR/?user=janviProblem while adding store procedure to dbml class which returns 2 datatable.hi <div>i m adding store procedure to dbml class which returns 2 data table.</div> <div>But in dbml's designer.cs file it takes only first datatable fields.</div> <div>so is there any way to get 2nd datatable in designer.cs file and display that fields in browser??</div> <div>i m using sql server 2008 and vs2008 with linq.</div> <div>thanks in advance for the rpl.</div>Wed, 19 Aug 2009 12:31:07 Z2009-08-19T17:52:17Zhttp://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/b58452e4-5246-4d9a-a81c-da96a6c870a8http://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/b58452e4-5246-4d9a-a81c-da96a6c870a8EvilPenguinhttp://social.msdn.microsoft.com/Profile/fr-FR/?user=EvilPenguinLinq-to-SQL associations being silently ignored under VS2010Hi,<br/> <br/> I have a Linq-to-SQL DBML set referencing the SQL Server system views (sys.tables, sys.columns, etc) which was created in fully patched Visual Studio 2008 SP1.  I'm pretty sure it worked in 2008, but I can no longer confirm.<br/> I reformatted and installed Windows RC and VS2010.  The Associations still exist in the DBML and I can see them on the designer surface, but the generated code does not contain the expected children collection/parent references.<br/> <br/> I have other similar DBML sets that work perfectly fine (although they are to tables, not views).  If I recreate a sample using just the tables and columns views, I get the same result.<br/> I get no errors or warnings either from 'Run Custom Tool' or building.<br/> <br/> Has anyone else had any similar problems or have any suggestions?Fri, 26 Jun 2009 06:43:27 Z2009-06-29T02:43:28Zhttp://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/58f721c8-0db5-4305-9c54-077f2037966ahttp://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/58f721c8-0db5-4305-9c54-077f2037966ajc0616http://social.msdn.microsoft.com/Profile/fr-FR/?user=jc0616find average using linqI have float[] abc = new float[]{10,20,1,80,6,90,78}<br/><br/>I want to find average of 2 elemets each and find minimum of those averages. how can i do that using LINQ in a better way.<br/><br/><br/>I want to do something like following.<br/>for(int i=0;i&lt;abc.length;i++)<br/>{<br/>avg = (abc[0]+abc[1])/2<br/>for(int i=2;i&lt;abc.length;i++)<br/>{<br/>    temp = (abc[i]+abc[i+1])/2<br/>    if(temp&lt;avg)<br/>       avg=temp;<br/>}<br/><br/>}<br/>Thu, 11 Jun 2009 12:06:25 Z2009-06-23T04:26:38Zhttp://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/4cfd9e29-af5a-40a7-9efc-73e0713f2319http://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/4cfd9e29-af5a-40a7-9efc-73e0713f2319AviationPlanninghttp://social.msdn.microsoft.com/Profile/fr-FR/?user=AviationPlanningBeta1 Changes?I was wondering what changes have been made to the Linq to SQL framework in Beta1?  I was playing around with it but I can't seem to find any improvements.<br/>Sat, 23 May 2009 02:39:22 Z2009-06-02T00:38:10Zhttp://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/39aff9f8-bdf5-4aa8-9c33-852674e5aae4http://social.msdn.microsoft.com/Forums/fr-FR/linqtosqlprerelease/thread/39aff9f8-bdf5-4aa8-9c33-852674e5aae4eric.cahoonhttp://social.msdn.microsoft.com/Profile/fr-FR/?user=eric.cahoonLinq2Sql Shared Common Table causes Entity name conflict when using Dynamic DataI have project where I am create Linq 2 Sql files for each group of business objects.  For this case these groups are People and Users.  There is a relationship of a User to Person but a person can stand alone.  The issue is that both of these Linq files has a reference to table named dbo.People.  When I try to run this project in a Dynamic Data project I get the following error.<br/><br/> <h2><em>The name for entity 'openPlat.Models.PeopleTables.People' in context 'openPlat.Models.PeopleTables.PeopleDataContext' conflicts with the name for the entity 'openPlat.Models.UserTables.People' in context 'openPlat.Models.UserTables.UsersDataContext'.</em></h2> <span style="font-family:Arial, Helvetica, Geneva, SunSans-Regular, sans-serif"><strong><span style="font-family:Verdana">Description: </span></strong>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. <br/><br/><strong><span style="font-family:Verdana">Exception Details: </span></strong>System.ArgumentException: The name for entity 'openPlat.Models.PeopleTables.People' in context 'openPlat.Models.PeopleTables.PeopleDataContext' conflicts with the name for the entity 'openPlat.Models.UserTables.People' in context 'openPlat.Models.UserTables.UsersDataContext'.<br/><br/><strong><span style="font-family:Verdana">Source Error:</span></strong> <br/><br/> <table border=0 width="100%" bgcolor="#ffffcc"> <tbody> <tr> <td><code> <pre>Line 28: // class in your application. Line 29: model.RegisterContext(typeof(openPlat.Models.UserTables.UsersDataContext), new ContextConfiguration() { ScaffoldAllTables = true }); <span style="color:#ff0000">Line 30: model.RegisterContext(typeof(openPlat.Models.PeopleTables.PeopleDataContext), new ContextConfiguration() { ScaffoldAllTables = true }); </span>Line 31: Line 32: // The following statement supports separate-page mode, where the List, Detail, Insert, and </pre> </code></td> </tr> </tbody> </table> <br/><strong><span style="font-family:Verdana">Source File: </span></strong>H:\Users\Owner\Documents\Visual Studio 2008\Projects\openPlat\openPlat\Global.asax.cs<strong><span style="font-family:Verdana">    Line: </span></strong>30 <br/><br/><strong><span style="font-family:Verdana">Stack Trace:</span></strong> <br/><br/> <table border=0 width="100%" bgcolor="#ffffcc"> <tbody> <tr> <td><code> <pre>[ArgumentException: The name for entity 'openPlat.Models.PeopleTables.People' in context 'openPlat.Models.PeopleTables.PeopleDataContext' conflicts with the name for the entity 'openPlat.Models.UserTables.People' in context 'openPlat.Models.UserTables.UsersDataContext'.] System.Web.DynamicData.MetaModel.CheckTableNameConflict(MetaTable table, String nameOverride, List`1 tablesToInitialize) +159679 System.Web.DynamicData.MetaModel.RegisterContext(DataModelProvider dataModelProvider, ContextConfiguration configuration) +758 System.Web.DynamicData.MetaModel.RegisterContext(Func`1 contextFactory, ContextConfiguration configuration) +359 System.Web.DynamicData.MetaModel.RegisterContext(Type contextType, ContextConfiguration configuration) +79 openPlat.Global.RegisterRoutes(RouteCollection routes) in H:\Users\Owner\Documents\Visual Studio 2008\Projects\openPlat\openPlat\Global.asax.cs:30 openPlat.Global.Application_Start(Object sender, EventArgs e) in H:\Users\Owner\Documents\Visual Studio 2008\Projects\openPlat\openPlat\Global.asax.cs:59 [InvalidOperationException: An error occurred during model registration and this operation cannot be performed.] System.Web.DynamicData.MetaModel.CheckForRegistrationException() +160119 System.Web.DynamicData.MetaModel.get_Default() +4 openPlat._Default.Page_Load(Object sender, EventArgs e) in H:\Users\Owner\Documents\Visual Studio 2008\Projects\openPlat\openPlat\Default.aspx.cs:21 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 </pre> </code></td> </tr> </tbody> </table> </span><br/>Any advice on how to handle using a table in multiple Linq 2 Sql files would be greatly appreciated.Thu, 21 May 2009 03:43:47 Z2009-06-02T17:44:09Z