Unable to connect/Open SQL Server 2008 R2

I installed SQL Server 2008 R2 , VS2010 on a Windows 7 32 bit  laptop  and  created web application using C#.net but unable to login   plz find the web.config connection string
<add key="connstring" value="Integrated Security=True;Initial Catalog=MMO;Data Source=computername-pc"/>       OR 
 <add key="connstring" value="Data Source=computername\MSSQLSERVER;Initial Catalog=MMO"/>

Open in new window

it gives error (A network related or instance specific error bla bla ., could not open a connection to sql server )
i follow the instructions mentioned in the URL  http://www.technologycrowds.com/2014/02/could-not-open-connection-to-sql-server.html     error is not yet resolved
i changed Data Source
<add key="connstring" value="Integrated Security=True;Initial Catalog=MMO;Data Source=myPCName\SQLEXPRESS"/>

Open in new window

it gives the another  error( "Cannot open database "MMO" requested by the login. The login failed. Login failed for user")
Please Help me out to solve these issues
prashanth agsoftware engineer Asked:
Who is Participating?

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

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.

Vikas GargAssociate Principal EngineerCommented:

there is a similar question on Expert Exchange Hope that will help you..

Vitor MontalvãoMSSQL Senior EngineerCommented:
It's a SQL Server Express Edition and do you confirm that SQL Browser is running and Named Pipes enabled for the SQL Server instance?
Carl TawnSystems and Integration DeveloperCommented:
The second error suggests that you either haven't added your windows login account as a login on the database; don't have a database called "MMO"; or haven't given your login permissions on that database.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

prashanth agsoftware engineer Author Commented:
Vitor MontalvãoMSSQL Senior EngineerCommented:
So you have 2 SQL Server instances. To which one are you trying to connect?
prashanth agsoftware engineer Author Commented:
i tried  both , i open reporting service configuration manager it shows MSSQLSERVER (sql server instance )
HuaMin ChenProblem resolverCommented:
Try to put this
		<add name="conn2" connectionString="Data Source=192.?.?.?\your_db_instance;Initial Catalog=your_db_schema;Integrated Security=False;User ID=your_db_login;Password=??????" providerName="System.Data.SqlClient"/>

Open in new window

within Web.config/app.config file in your project, to ensure the project will work fine with the database.
Vitor MontalvãoMSSQL Senior EngineerCommented:
MSSQLSERVER is the default instance so you must not add it as instance name.

<add key="connstring" value="Integrated Security=True;Initial Catalog=MMO;Data Source=computername"/>

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
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

From novice to tech pro — start learning today.