Asp.net MVC Hosting - SQL Server

19 sie 2016, 10:16
kratoss

kratoss

Początkujący User 1 posty 25 pkt.

Asp.net MVC Hosting - SQL Server

19 sie 2016, 10:16
So I'm moving my Asp.net mvc web app over to Asphostportal shared hosting. This is the first time I've deployed an MVC app. I have been using SQL Server 2008 Express for the development database. Asphostportal provides SQL Server 2008 or MySQL hosted databases.

A couple questions:

1.Can I use the mdf files from my Express database with the new Non-Express prodcution DB?

2.I'm having issues with my connection string. I changed the original web config connection string from this

[ <add name="Database1ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database1.mdf;Integrated Security=True;User Instance=True"
providerName="System.Data.SqlClient" />
]

to this:

[ <add name="Database1ConnectionString" connectionString="Data Source=.;Integrated Security=SSPI;Initial Catalog=ProdsDB"
providerName="System.Data.SqlClient" />
]

Now I'm getting this error: Cannot open database "ProdsDB" requested by the login. The login failed

I have setup the database called "ProdsDB" through the Asphostportal control panel and added one user. Do I need to add the credentials somewhere in the connection string?

Re: Asp.net MVC Hosting - SQL Server

19 sie 2016, 13:06
grzemach

grzemach

Wielki Procesor 2572 posty 1569 pkt.

Re: Asp.net MVC Hosting - SQL Server

19 sie 2016, 13:06
On first I'm not 100% sure. But Express is more simple DB, so all should work.

On second.
"Do I need to add the credentials somewhere in the connection string" - YES :)
http://stackoverflow.com/questions/1229 ... urity-sspi
https://www.connectionstrings.com/sql-server/
  • Brak nieprzeczytanych postów
  • Nieprzeczytane posty
  • Wątek zablokowany
  • Wątek przeniesiony
cron
widget instagram lenovo
widget twitter lenovo
widget facebook lenovo
widget youtube lenovo