A
Andy B.
I am using entity framework to create database data access code. For some
wierd reason, I keep getting the following error but I don't even have an
object in the database with the name the error claims is invalid. I used to
have a database table with that name but since deleted it ages ago. Any way
to fix the problem? I even went so far as to create a brand new web project
and hand ported code over but the error keeps coming up. I can create and
add new objects and delete objects but for some reason I can't update
objects. Here is the error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Invalid object name 'News.News'.
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 originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Invalid object name
'News.News'.
Source Error:
Line 55:
Line 56:
Line 57: Return DBContext.SaveChanges()
Line 58: End Function
Line 59:
Source File: C:\Documents and Settings\Andy B\My Documents\Visual Studio
2008\Projects\Eternity Records\Website\Modules\News.vb Line: 57
Stack Trace:
[SqlException (0x80131904): Invalid object name 'News.News'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception,
Boolean breakConnection) +1950890
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection) +4846875
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,
RunBehavior runBehavior, String resetOptionsString) +204
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
+954
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method,
DbAsyncResult result) +162
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
result, String methodName, Boolean sendToPipe) +175
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator
translator, EntityConnection connection, Dictionary`2 identifierValues,
List`1 generatedValues) +554
System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager
stateManager, IEntityAdapter adapter) +281
[UpdateException: An error occurred while updating the entries. See the
InnerException for details.]
System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager
stateManager, IEntityAdapter adapter) +491
System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager
entityCache) +117
System.Data.Objects.ObjectContext.SaveChanges(Boolean
acceptChangesDuringSave) +453
System.Data.Objects.ObjectContext.SaveChanges() +9
Website.News.News.UpdateNews(Guid NewsID, String Title, String
Description, String Body) in C:\Documents and Settings\Andy B\My
Documents\Visual Studio 2008\Projects\Eternity
Records\Website\Modules\News.vb:57
Website.News.UI.Edit.EditNewsWizard_NextButtonClick(Object sender,
WizardNavigationEventArgs e) in C:\Documents and Settings\Andy B\My
Documents\Visual Studio 2008\Projects\Eternity
Records\Website\Controls\News\Edit.ascx.vb:33
System.Web.UI.WebControls.Wizard.OnNextButtonClick(WizardNavigationEventArgs
e) +108
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs
e) +418
System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source,
EventArgs args) +19
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
+166
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
wierd reason, I keep getting the following error but I don't even have an
object in the database with the name the error claims is invalid. I used to
have a database table with that name but since deleted it ages ago. Any way
to fix the problem? I even went so far as to create a brand new web project
and hand ported code over but the error keeps coming up. I can create and
add new objects and delete objects but for some reason I can't update
objects. Here is the error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Invalid object name 'News.News'.
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 originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Invalid object name
'News.News'.
Source Error:
Line 55:
Line 56:
Line 57: Return DBContext.SaveChanges()
Line 58: End Function
Line 59:
Source File: C:\Documents and Settings\Andy B\My Documents\Visual Studio
2008\Projects\Eternity Records\Website\Modules\News.vb Line: 57
Stack Trace:
[SqlException (0x80131904): Invalid object name 'News.News'.]
System.Data.SqlClient.SqlConnection.OnError(SqlException exception,
Boolean breakConnection) +1950890
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection) +4846875
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj) +194
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj) +2392
System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,
RunBehavior runBehavior, String resetOptionsString) +204
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
+954
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method,
DbAsyncResult result) +162
System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult
result, String methodName, Boolean sendToPipe) +175
System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +137
System.Data.Mapping.Update.Internal.DynamicUpdateCommand.Execute(UpdateTranslator
translator, EntityConnection connection, Dictionary`2 identifierValues,
List`1 generatedValues) +554
System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager
stateManager, IEntityAdapter adapter) +281
[UpdateException: An error occurred while updating the entries. See the
InnerException for details.]
System.Data.Mapping.Update.Internal.UpdateTranslator.Update(IEntityStateManager
stateManager, IEntityAdapter adapter) +491
System.Data.EntityClient.EntityAdapter.Update(IEntityStateManager
entityCache) +117
System.Data.Objects.ObjectContext.SaveChanges(Boolean
acceptChangesDuringSave) +453
System.Data.Objects.ObjectContext.SaveChanges() +9
Website.News.News.UpdateNews(Guid NewsID, String Title, String
Description, String Body) in C:\Documents and Settings\Andy B\My
Documents\Visual Studio 2008\Projects\Eternity
Records\Website\Modules\News.vb:57
Website.News.UI.Edit.EditNewsWizard_NextButtonClick(Object sender,
WizardNavigationEventArgs e) in C:\Documents and Settings\Andy B\My
Documents\Visual Studio 2008\Projects\Eternity
Records\Website\Controls\News\Edit.ascx.vb:33
System.Web.UI.WebControls.Wizard.OnNextButtonClick(WizardNavigationEventArgs
e) +108
System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs
e) +418
System.Web.UI.WebControls.WizardChildTable.OnBubbleEvent(Object source,
EventArgs args) +19
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
+166
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565