Try to use .dbo in SQL Server but got error..

Mar 21, 2011 at 12:02 AM
Edited Mar 21, 2011 at 12:39 AM

hi~because I couldn't get MvcMusicStore.mdf connected every time so tried to build the script in SQL Server 2008 where MvcMusicStore.dbo could get connected more easily..

here is my connectionStrings

  <add name="MusicStoreEntities" connectionString="server=FAY-PC\SQLEXPRESS;
       integrated security=SSPI;database=MvcMusicStore" />

but I got this error:

Exception Details: System.InvalidOperationException: The connection string 'MusicStoreEntities' in the application's configuration file does not contain the required providerName attribute."

Source Error:

Line 25:             // Group the order details by album and return
Line 26: // the albums with the highest count
Line 27: return storeDB.Albums
Line 28: .OrderByDescending(a => a.OrderDetails.Count())
Line 29: .Take(count)

is that the same problem with   "Invalid object name 'dbo.Genres' ... "?


is anyone have some experience with using the SQL script in SQL Server without using .mdf could help me,please?


Thank you so much !!!

Mar 21, 2011 at 12:35 AM

The error message is referring to the providerName

Try this

<add name="MusicStoreEntities" connectionString="Data Source=FAY-PC\SQLEXPRESS;Initial Catalog=MvcMusicStore;Integrated Security=SSPI;" providerName="System.Data.SqlClient" />

Mar 21, 2011 at 12:49 AM

Thank you so much madisonJames !:)

I can now view the page~~ also following Invalid object name 'dbo.Genres' ...   really helpful~~


Thank you all the people all the work~~learn and help me a lot~~!