none
does not contain a definition for 'ExecuteCommand' RRS feed

  • Question

  • My LINQ broke.  This is a project that I haven't touched in several months, so I'm not sure if I did something previously that broke LINQ or work.  Basically my my LINQ to SQL datacontext doesn't know it's a linq to sql datacontext.  I have no idea why.  When I rebuild there are a bunch of errors saying as such, including the one from the title.  So, basically I just need to know where to start.
    Friday, July 16, 2010 12:50 PM

Answers

  • Hi Matthew,

    What's the version of visual studio you are using ? If you are using Visual Studio 2008 SP1 and if you have a partial class with Using statement at the top of the file for a Linq-To-SQL Data Classes context object. You will get the error("The custom tool 'MSLinqToSQLGenerator' failed.  Unspecified error"). Visual Studio will delete the corresponding “.designer.cs” file for your data context and nothing will be compiled.  To solve this issue, you may have to move “Using” statements inside namespace declaration.

    Best regards,
    Alex Liang


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, July 20, 2010 3:50 AM
    Moderator

All replies

  • I created a new datacontext... I think the problem occurs when I drag a table from the Server Explorer onto the datacontext.  I don't know why or how to fix it.
    Friday, July 16, 2010 1:41 PM
  • It sounds like LINQ to SQL is having a problem generating the code for your datacontext subclass.

    There will be an error in the list that relates to that - try sorting by the filename column to find out what the problem is.

    [)amien

    Friday, July 16, 2010 2:57 PM
    Moderator
  • I rolled back to a previous version which got the project to build.  However, when I add new Data Classes to the project, those classes cannot be instantiated or queried (after a successful rebuild). The rebuilds occur with no error.  So that tells me that the designer.cs is not being updated/generated properly.
    Friday, July 16, 2010 4:59 PM
  • When I re-enable warnings in the designer.cs file I get this warning after a rebuild:

    Warning 1 The custom tool 'MSLinqToSQLGenerator' failed.  Unspecified error

    Friday, July 16, 2010 5:01 PM
  • Hi Matthew,

    What's the version of visual studio you are using ? If you are using Visual Studio 2008 SP1 and if you have a partial class with Using statement at the top of the file for a Linq-To-SQL Data Classes context object. You will get the error("The custom tool 'MSLinqToSQLGenerator' failed.  Unspecified error"). Visual Studio will delete the corresponding “.designer.cs” file for your data context and nothing will be compiled.  To solve this issue, you may have to move “Using” statements inside namespace declaration.

    Best regards,
    Alex Liang


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Tuesday, July 20, 2010 3:50 AM
    Moderator