{"id":1686,"date":"2022-08-30T15:18:36","date_gmt":"2022-08-30T15:18:36","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/27\/problem-about-linq-project-general-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:18:36","modified_gmt":"2022-08-30T15:18:36","slug":"problem-about-linq-project-general-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/problem-about-linq-project-general-collection-of-common-programming-errors\/","title":{"rendered":"problem about linq-project-general-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-i-l-forums linq-project-general<br \/>\nI have english XP Pro plus sp2 on my laptop. When i installed LINQ CTP (May 2006), there\u00a0was a window titled &#8220;Visual Studio Just-In-Time Debugger&#8221; coming out about 14 times, it says &#8220;An unhandled exception (&#8220;Object doesn&#8217;t support this property or method: &#8220;Ver1&#8243;) occured in msiexe.exe[1116].&#8221;, and gives me the choice to debug or not. I clicked &#8220;No&#8221; button to not debug the exception, and the install finished eventually.\u00a0 I also noticed this error windo<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-i-l-forums linq-project-general<br \/>\nHi,I am trying to autogenerate the Object Model using Code Generation.In the &#8220;Visual Studio 2005 Command Prompt&#8221; I type:cd &#8220;C:\\Programmer\\Microsoft\\.NET Pet Shop 4.0\\LINQLibrary1&#8243;&#8221;C:\\Programmer\\LINQ Preview\\Bin\\SqlMetal.exe&#8221; \/server:localhost\\SQLExpress \/database:&#8221;C:\\Temp\\MSPetShop4.mdf&#8221; \/pluralize \/code:mspetshop.csHowever, I get the same frustrating exception, time after time:Unhandled Exception: System.Data.SqlClient.SqlException: Cannot open database &amp;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-i-l-forums linq-project-general<br \/>\nWhat would cause this error?\u00a0 The site works fine locally.\u00a0 I uploaded the System.Data.Linq 3.5 assembly into the bin directory on the shared hosting site b\/c I thought they were using an older version but that didn&#8217;t fix it.Server Error in &#8216;\/&#8217; Application.Method not found: &#8216;Void System.Data.Linq.Table`1.InsertOnSubmit(!0)&#8217;. Description: 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<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-i-l-forums linq-project-general<br \/>\nI get the following exception on a simple LINQ query to the NorthWindCTP database as follows;[1] Unhandled Exception: System.Data.SqlClient.SqlException: Invalid object name &#8216;Customers&#8217;.I have tryed to permute the SQLMetal command line for the (A) \/Pluralize and (B) \/map options.Each time I get the same results (using variations of the SQLMetal output).The code is &#8216;right out of the book&#8217; so to speak.I keep going throught the code but can&#8217;t seem to find a problem (it compiles and mostly runs :-).<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-i-l-forums linq-project-general<br \/>\nHi all,I had an IQueryable&lt;Customer&gt; custs,\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 a Customer cust,\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 a CustomerComparer custCp which implements IEqualityComparer&lt;Customer&gt;1. when I callcusts.Contains(cust,custCp)I got an exception:Unhandled Exception: System.NotSupportedException: Unsupported overload used for\u00a0query operator &#8216;Contains&#8217;.2. when I callcusts.AsEnumerable().Contains(cust,custCp)it worked.I checked the definition of the two:public static bool Contains&lt;TSource&gt;(this IQueryable&lt;TSource&gt;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-i-l-forums linq-project-general<br \/>\nAfter use SubmitChanges() in my Sql Server 2000 database, the application fails and show the next exception:\u00a0 Unhandled Exception: System.ObjectDisposedException: Cannot access a disposed object.Object name: &#8216;Transaction&#8217;.How can i do to resolve this problem.\u00a0 I use Sql Server 2000 and Windows XP Service Pack 2Thanks.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-i-l-forums linq-project-general<br \/>\n\u00a0Hi,I tried to run SQLMetal on command prompt in Windows vista, but it does not create the file and\u00a0throws &#8220;Unhandled exception : System.UnauthorizedAccessException : Access to the path C:\\ is denied&#8221;\u00a0error. What should I do?? what is the solution for it??Thanks in advance.Maulik Khandwala<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-i-l-forums linq-project-general<br \/>\nThe DataContext.DetachDatabase method is not implemented yet (as of the May 2006 CTP).\u00a0 It throws the following exception when calling it:Unhandled Exception: System.NotImplementedException: The method or operation is not implemented.\u00a0\u00a0 at System.Data.DLinq.SqlClient.SqlContext.DetachDatabase()\u00a0\u00a0 at System.Data.DLinq.DataContext.DetachDatabase()\u00a0\u00a0 at LINQChapter6.Program.Listing6_S() in c:\\Documents and Settings\\HP_Administrator\\My Documents\\Visual Studio 2005\\Projects\\LINQChapter6\\LINQChapter6\\<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-i-l-forums linq-project-general<br \/>\nWhen I refer to an inherited class in the following program, it is throwing an Unhandled Exception with the following message: &#8220;Bad Key Member: 0: ScheduledTask.ExamPaperID in [ExamPaperID]&#8221;.I think this is a bug in the implementation. Is there any work around for now?namespace TestingLinq{\u00a0\u00a0\u00a0 class Program\u00a0\u00a0\u00a0 {\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 static void Main(string[] args)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 string databaseFileName = @&#8221;C:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\MSSQL\\Data\\Testing.mdf&#8221;;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-i-l-forums linq-project-general<br \/>\nI already sent this to Matt Warren personally but also posted here:&#8230;I&#8217;m on the verge of insanity here.I can&#8217;t really explain how I got into this situation. I was well on the way to making a kick-*** application, then I needed to go back to the database and abstract out some image fields into another table so I could get lazy-load so I didn&#8217;t lock up the app UI over a VPN link to a database. The strange thing, is that it all worked before I started messing around. Obviously now I have removed a<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-i-l-forums linq-project-general<br \/>\nI mailed mattwarr and mcharles about this, and copied here.Relevant files all here:http:\/\/www.developer-x.com\/experiments\/dlinqproblem\/emptysequence\/ Dear Mathew,Many thanks for posting your resolution last week. I didn&#8217;t reply immediately because I was still confused about testcase1 vs. testcase2 but I stupidly had some UpdateCheck=Never calls in the testcase1 which I should have checked for.I wrote a small 4 line program since then to automatically add the false update checks after code genera<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.msdn.microsoft.com\/dn186180.LOGO_Win1211(id-id,MSDN.10).png\" \/><br \/>\nmsdn<br \/>\narchived-forums-i-l-forums linq-project-general<br \/>\n\u00a0I&#8217;m having an issue commiting changes in a linq data context. I&#8217;m editing a hirarchy of data, but I have direct access to the datacontext the whole time, so I don&#8217;t have to worry about detaching or attaching objects, simply commiting changes (which simplifies my life ever so greatly).Here&#8217;s the issue. I start a new dc, retreive a few objects using the dc, some of which are join entries, edit them, then commit the changes. The first time through it works beautifully, flawlessly. While running th<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2013-11-27 12:29:53. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>msdn archived-forums-i-l-forums linq-project-general I have english XP Pro plus sp2 on my laptop. When i installed LINQ CTP (May 2006), there\u00a0was a window titled &#8220;Visual Studio Just-In-Time Debugger&#8221; coming out about 14 times, it says &#8220;An unhandled exception (&#8220;Object doesn&#8217;t support this property or method: &#8220;Ver1&#8243;) occured in msiexe.exe[1116].&#8221;, and gives me the choice to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1686","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1686"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1686\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}