Click here to Skip to main content
15,616,520 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

<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 .

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
i'm sorry , I described is not clear enough 。 :)

first , 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=""></a>[<a href="" target="_blank" title="New Window">^</a>]
Share this answer
http://www.microsoft => crucial stuff page => link to SSMSE2k8 (x64 or x86, take 'yer pick) => 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?


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