Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
paradise_wolf
Starting Member
32 Posts |
Posted - 2008-01-15 : 17:19:18
|
| I am developing a web site with asp.net 2.0 and c#, using Visual Studio 2005 and Microsoft SQL Server 2005 ( I am still learning about these technologies and languages ).I transferred my web site files to a new computer. I created a empty SQL database called “SiteData.mdf”, I stopped the SQL server and then I replaced this database with a previous one with the same name and already populated with data.I used this maneuver in order to avoid having to insert all data again.The web site works fine when running inside Visual Studio, however when I try to run it in its published format it gives this error message:~~~~~~~~~~Server Error in '/MA' Application. Cannot open database "SiteData" requested by the login. The login failed.Login failed for user 'CENTAURUS\ASPNET'. ~~~~~~~~~~~I also observed that inside the SQL Server Management Studio, in the database properties, it shows “ETHER\ASPNET” as User or Roles ( however “ETHER\ASPNET” was created using the old computer’s name [ or should I say domain ? ]) but the permissions list correctly displays the new name “CENTAURUS\ASPNET”. I think that I, probably, should create a new user using the name “CENTAURUS\ASPNET” because it would use the name of the new computer ( or domain ) and then I should delete the old user name. Actually I tried to do that but I get the message “An object named ‘CENTAURUS\ASPNET’ cannot be found”.So,1) What should I do to get the database being connected with the published web site ( note: I am publishing it in my own computer for awhile ) ?2) How do I create the new user name “CENTAURUS\ASPNET” ?3) I also would like to know why the name of the database in the Server Explorer panel of VS appears as “centaurus.SiteData.dbo” –while- inside the Object Explorer panel of the SQL Server Management Studio it appears simply as “SiteData” ? |
|
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2008-01-16 : 07:35:46
|
| the reason for your error is your database is not added to your user name.the solution is : go to security(in that particular server)then click on loginsthere you can find your user nameright click on that username...goto propertiesselect user mappingselect your database if the check box is not checked, check it.then at the right side click on button,select browse, there check the desired. then it works.let me know the statusVinodEven you learn 1%, Learn it with 100% confidence. |
 |
|
|
|
|
|
|
|