Click here to Skip to main content
15,886,014 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
hi i'm Michael

i'm sure the sql2008 can work with mvc3.0 . but i'm don't know how to write connection string in web.config .

this's my connection string

HTML
<add name="MovieDBContext">
   connectionString="Data Source=bj-michael;Initial Catalog=Movie;User Id=sa;Password=`1qaz2wsx;"
   providerName="System.Data.SqlClient" /> </add>


but is allways throw Object name 'dbo.Movies' invalid..

but if i create an same table movies in database movie . then it's alright .



so i wanna know ,does sql2008 with mvc3.0 will not auto create table ? thanks .
Posted

SQL will never "auto create" a table for you. You have to tell it to do it explicitly.

I don't really think that is your problem: Your code above does not refer to any table, so it cannot be raising the error you describe.
What code are you actually using that does cause this problem?
 
Share this answer
 
XML
i'm sorry , I described is not clear enough 。 :)

first , Asp.net mvc3.0 has a mechanism, that code first. If work with CE4.0 used together, can need not create database, also need not creating tables. But i wanna work with sqlserver . i don't know how to do it .

look this

<a href="http://weblogs.asp.net/scottgu/archive/2010/12/08/announcing-entity-framework-code-first-ctp5-release.aspx">http://weblogs.asp.net/scottgu/archive/2010/12/08/announcing-entity-framework-code-first-ctp5-release.aspx</a>[<a href="http://weblogs.asp.net/scottgu/archive/2010/12/08/announcing-entity-framework-code-first-ctp5-release.aspx" target="_blank" title="New Window">^</a>]
 
Share this answer
 
http://www.microsofthttp://msdn.microsoft.com/en-us/library/ms365247.aspx => crucial stuff page
http://www.microsoft.com/download/en/details.aspx?id=23650 => link to SSMSE2k8 (x64 or x86, take 'yer pick)
http://sqlserversamples.codeplex.com/ => link to AdventureWorks database samples

~~~~~~~~~~

In addition, download the "SQL Server 2008 R2 Combined Help Collection", whereever THAT is located ...

And 'yer ready to learn T-SQL!

Advise: Judging from the date of this page you point to, Scott Guthries' ASP.NET MVC announcement of Dec 2010, and not that Dec 2010 is a stale date really, but I have issues with a link found THEN to SQL2000 (Ecod, man!); possibly a more appropriate reference would have been/should be made to SSMS Express R2 in a Dec 2010 time frame, yes?

P.S.

If there ever was anything that Microsoft did right in the time period bewteen the release of Visual Studio 2005 and the debugging of the x64 platform as we know it today, it was creating this nice SQL Server help volume. Oh, and giving us SSMSE2k8 (in all it's incarnations ...)!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900