ConnectionStrings in web.config configuration file

I am trying to setup complete Microsoft SQL Server to another machine, for this I successfully restored db into Microsoft SQL Server Express 2008 R2 version from Microsoft SQL server 2000 version.

Now I am using ASP.NET and Microsoft SQL Server 2008 R2 Express for creating asp.net forms authentication , the .aspx.file is not connected to a database, I got an error like Login failed for user 'vinay' while compiling .aspx file on browser with IP Address. I gave database authentication in web.config file, Is anywhere wants to give database authentication other than web.config file. My database name is : CPS, password is: Indi123$, userId is : vinay and I server Name: my system name i.e, IV-27, but I have a doubt why we are using key in connectionString, my statement in web.cofig for database connection is  <add key="CPSWebAppl" value="Server=IV-27;Database=CPS;UId=vinay;Password=Indi123$;" />

Below is the attachment of I got error while compiling .aspx file on browser with IP Addressgetting error while compiling .aspx file on browser with IP Address.

Please help me to compile with IP address in browser.
Keerthi KamarthiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin MillerCTOCommented:
Please try a  manual SQL-Client application first, with this setting for user and password.

If this does not work, your web.config won't either...

You want to eliminate the easy problem first, then work on network and security challenges.

Martin
0
Shaun VermaakTechnical SpecialistCommented:
SQL Express connection string server is usually .\SQLExpress

Something like
Server=.\SQLExpress;AttachDbFilename=C:\MyFolder\MyDataFile.mdf;Database=dbname;Trusted_Connection=Yes;

Open in new window

https://www.connectionstrings.com/sql-server/
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Vitor MontalvãoMSSQL Senior EngineerCommented:
Hopefully you're using a  Server, User ID and Password as isn't good idea to post those kind of information in a public website.
0
Alan WarrenApplications DeveloperCommented:
If you are using the ASP .Net membership server and login controls, the most likely issue you would encounter when migrating your application to another machine is an ApplicationID mismatch. In the sql table [dbo].[aspnet_Applications], you would generally have only one record and all your users in the table [dbo].[aspnet_Membership] would be associated/bound to the ApplicationID in the table [dbo].[aspnet_Applications]. When you are attempting to login using an ASP .Net login control, the ApplicationID is parsed to the SQL server, if you have created a new application on a new machine or migrated an existing application to a new machine, there is a possibility the ApplicationID being parsed by the login controls is different to what is stored in the tables [dbo].[aspnet_Applications] and [dbo].[aspnet_Membership] . An easy way to test this is to create a new user using the create new user form/wizard in your new application on the new machine and then check the table [dbo].[aspnet_Applications] for a new record. If you do have a new record, you may need to update your existing records in the [dbo].[aspnet_Membership] table to use the new ApplicationID. Perhaps try it with one user record first, maybe vinay. I believe that password recovery can be affected by using this method because the algorithm that decrypts passwords uses a combination of  ApplicationID, UserID and Answer to secret question to decrypt, so you may need to reset your security credentials after updating the applicationID associated with your membership.userID.
0
Martin MillerCTOCommented:
Can we close this?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.