none
C# application that is using the ADO.NET Entity Data Model RRS feed

  • Question

  • I am having trouble with C# application that is using the ADO.NET Entity Data Model after modifying an existing table. 

    Here is the project information:

    • Visual Studio 2010 C# Windows Forms Application.  (I inherited the application from another developer that is no longer available.  It is a large project that took several months to develop.)
    • Using SQL Server Express 2008 R2 for database support.
    • The project is using DataViewGrids to display several tables from the database.
    • I added two columns to one of the tables.  I used the data modeling tools to update data model.

    The Problem:

    The application works fine in Visual Studio and installed on my development machine.  However, once it is installed on the end user machine it crashes when the updated table is connected to the data grid.  There remaining tables connect their respective data grids without any problem.  Unless I am completely missing something, it seems like a bug in Visual Studio.

    What I have tried:

    • Manually verified the data model code, it looks correct.
    • Recreated the project settings many, many, times.
    • Uninstalled SQL Server and related components and reinstalled them.
    • Ran Windows Update to make sure all machines are correctly patched.

    I appreciate any help or feedback you can provide.

    Thanks!

    Wednesday, April 9, 2014 8:11 PM

Answers

  • "An error occurred while executing the command definition.  See the inner exception for details."

    Take note:

    http://msdn.microsoft.com/en-us/library/system.exception.tostring(v=vs.110).aspx

    <copied>

    The default implementation of ToString obtains the name of the class that threw the current exception, the message, the result of calling ToString on the inner exception, and the result of calling Environment.StackTrace. If any of these members is null, its value is not included in the returned string.

    If there is no error message or if it is an empty string (""), then no error message is returned. The name of the inner exception and the stack trace are returned only if they are not null.

    <end>

    • Marked as answer by tlfuller Thursday, April 17, 2014 5:29 AM
    Thursday, April 10, 2014 5:32 AM

All replies

  • It crashes and throws no exception message?
    Wednesday, April 9, 2014 10:16 PM
  • Here is the exception message it displays:

    "An error occurred while executing the command definition.  See the inner exception for details."

    Next, it displays the Application has stopped working message which has the Check online for a solution and close the program option, or the Close the program option.

    • Edited by tlfuller Thursday, April 10, 2014 4:38 AM
    Thursday, April 10, 2014 4:25 AM
  • "An error occurred while executing the command definition.  See the inner exception for details."

    Take note:

    http://msdn.microsoft.com/en-us/library/system.exception.tostring(v=vs.110).aspx

    <copied>

    The default implementation of ToString obtains the name of the class that threw the current exception, the message, the result of calling ToString on the inner exception, and the result of calling Environment.StackTrace. If any of these members is null, its value is not included in the returned string.

    If there is no error message or if it is an empty string (""), then no error message is returned. The name of the inner exception and the stack trace are returned only if they are not null.

    <end>

    • Marked as answer by tlfuller Thursday, April 17, 2014 5:29 AM
    Thursday, April 10, 2014 5:32 AM