开发者

Editing the Connection String After backup the database to the server database

I'm still new in this :$

I've done the following:

  1. I've published the database to my disk.
  2. open the published script 'DB.MDF' using microsoft sql server management studio 2008.
  3. execute it and backup. it was in the master database under the System database.
  4. on the server, I have created a new user and new database with the same name.
  5. I did restore the DB.BAK and browser the database and I found my tables.

now I need to edit the connection string.. this is my connection sting from the config file:

<add name="AlBayanEntities" connectionString="metadata=res://*/Core.Model.AlBayan.csdl|res://*/Core.Model.AlBayan.ssdl|res://*/Core.Model.AlBayan.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\AlBayan.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

I've changed it to:

<add name="AlBayanEntities" connectionStri开发者_Python百科ng="Server=;Database=databaseName;Uid=bayan;Password=1abcd;" providerName="System.Data.EntityClient" />

and I got on my host plan this:

'You may also use SQL Server address above in your application connection strings, for example: ASP.NET (ADO.NET Library) Server=;Database=databaseName;Uid=userName;Password=password;'

am I doing right?

coz I still can't login to my website which means it didn't work because I have created a role from the ASP.NET configuration and still can't log in :/


In your example connection string you have

Database=databaseName

is "databaseName" the actual name of your database? It needs to be.


ASP.NET membership is usually hard for newbies to configure. I strongly suggest that you create a simple page first, and try to fetch few records from database to see if your connection string is right. If it's OK, then move to next troubleshooting steps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜