change connection string

  • 87 Views
  • Last Post 20 March 2017

hi

i installed mvcforum

every thing works

but when i changed connection string name in web.config and forum.config

Error:

Cannot open database "MVCForum.Services.Data.Context.MVCForumContext" requested by the login. The login failed.

datatbase not changed 

only connection string name updated

anyone help me

how can i update connection string name correctly!

 

 

Order By: Standard | Newest | Votes
Silly posted this 13 March 2017

You can do either options below 

<add name="MVCForumContext" connectionString="data source=[ADD YOUR SQL SERVER INSTANCE HERE];database=MVCForum;Trusted_Connection=True;" providerName="System.Data.SqlClient" />

 

                                       OR comment line above and uncomment line below and test it and see.

 

    <!--<add name="MVCForumContext" connectionString="Data Source=|DataDirectory|\MVCForum.sdf" providerName="System.Data.SqlServerCe.4.0" />-->

thanks

but

it is not  my problem

when i change connectionString name

example  :

<add name="MVCForumContext_2" connectionString="data source=[ADD YOUR SQL SERVER INSTANCE HERE];database=MVCForum;Trusted_Connection=True;" providerName="System.Data.SqlClient" />

Cannot open database "MVCForum.Services.Data.Context.MVCForumContext" requested by the login. The login failed.

 

 

YodasMyDad posted this 20 March 2017

You haven't got the correct permissions in SQL server.

Close