database - asp.net mvc tutorial project -


I'm having trouble getting the code to work with "Pro ASP.NET MVC Framework". I am on page 96 for those who have already worked through this book. When I run the code, I get the following:

  System.Data.SqlClient.SqlException was rejected by user code message Message = "Invalid object name 'products'." Source = "Net SqlClient Data Provider." Error = 2146232060 Class = 16 LineNumber = 1 Number = 208 Process = "" Server = "\\ SQLEXPRESSADV" State = 1 StackTrace:. System.Data.SqlClient.SqlInternalConnection.OnError (SqlException exception on System.Data.SqlClient.SqlConnection.OnError (System.Data.SqlClient.TdsParser, Boolean brake connection) SqlException exception, Boolean brake connection) System.Data. System.Data on System.Data.SqlClient.SqlDataReader.get_MetaData () on SqlClient.TdsParser.Run (RunBehavior Run Behavior), SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) System.Data.SqlClient.SqlCommand.FinishExecuteReader. On SqlClient.SqlDataReader.ConsumeMetaData (Command) on System.Data.SqlClient.SqlCommand.RunExecuteReaderTds (SqlDataReader DS, RunBehavior Run Beaver, String ResetOptSstring) (System.Data.SqlClient.SqlCommand.RunExecuteReader (Command Behavior on System.Data.SqlClient.SWLCommand.RunExecuteReader at System.Data.SqlClient.SqlCommand.RunExecuteReader (CommandBehavior) on the Behavior cmdBehavior, RunBehavior Run Behavior, Boolean Returns, String Method, DBsink Results Results, RunBehavior Run Beehavior, Boolean Backstream , Boolean async) SystemData.SqlClient.SqlCommand.ExecuteDbDataReader on SystemData.SqlClient.SqlCommand.ExecuteReader (CommandBehavior behavior, String Method) on System.Data.Common.DbCommand cmdBehavior, RunBehavior Run Beehavior, Boolean Returnstream, String Method). ExecuteReader () on System.Data.Linq.SqlClient.SqlProvider.Execute (expression query, qu EryInfo queryInfo, IObjectReaderFactory factory, object [] parentArgs, object [] userArgs, ICompiledSubQuery [] Subquery, Object LASTRESULT Total). SqlClient.SqlProvider.ExecuteAll on the System.Data.Linq (Expression Query, QueryInfo [] queryInfos, IObjectReaderFactory Factory bject [] ([userArguments, ICompiledSubQuery on System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute (query expression) on System.Data.Linq.Table`1.GetEnumerator] subquery)) TEntity & gt; On .GetEnumerator () on System.Collections.Generic.List`1..ctor (IEnumerable`1 Collection) System.Data.Linq.Table`1.System.Collections.Generic.IEnumerable on System.Linq.Enumerable & lt .ToList [TSource] (IEnumerable`1 source) on WebUI.Controllers.ProductsController.List () in C: \ documents and Settings \ adamsb1 \ My documents \ visual Studio 2008 \ projects \ StoreSolution \ WebUI \ controllers \ ProductsControllerkcs: [(ControllerBase controller object on line 28 System.Web.Mvc.ActionMethodDispatcher.Execute lambda_method] parameter) (ExecutionScope, ControllerBase, object []) on System.Web.Mvc.ReflectedActionDescriptor.Execute (ControllerContext controllerContext, IDictionary`2 standards ) On System.Web.Mvc.ControllerActionI System.We Vv.mvc.ControllerActionInvoker at b.Mvc.ControllerActionInvoker.InvokeActionMethodFilter (IActionFilter Filter) & Lt; & Gt; C__DisplayClassa & Lt; InvokeActionMethodWithFilters & gt; Nvoker.InvokeActionMethod (Controller Contact Controller Context, Action Descriptor Action Descriptor, IDictionary`2 parameter) in b__7 (). , Akshnakspiting Kantakt Preecontekst, Fnk` 1 continuity) Inner Akspasn:  

Makes fine with errors without all my code and it looks like a book. However, I can not get to work for this. I am an old school ASP boy so it is new to me.

The error is in the database or if you have indicated that the connection string is incorrectly indicated by the database, or the database that you are using, the table "product" is missing, which is expected to be there.

Since it looks like you're using a SQLExpress database, I think that you have not setup tutorial database - programs that have been set up on your machine before you SQLExpress database Trying to read it.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -