I'm not sure why you are doing all of this?

I think you have a point. I don't know, it's more like the principle really - the fact that I can connect using localhost\SQLEXPRESS on my work computer and the fact that it is so difficult to achieve something so simple on my home machine, which has the same configuration. Anyway, I think I'll forget about this and use localDB (with this connection string (localdb)\v11.0), providing that the only difference is the fact that I have to connect to it using a slightly different connection string, which isn't the end of the world after all.

@imti321: I still have the same problem, in that I can't connect to sqlexpress (I'm now downloading the data tools). As I said, nevermind, I can live with that as long as I can use localDB as I used SQLEXPRESS (same syntax except for the connection string)

No Never mind we are also learning with you.If there is a problem and it gets soloved we all who are following this post will learn it for ever.We have tried our best but getting discouraged is not what programmers are meant for.It is our job to find a solution not to back up.I am still astonished as to why it is showing same error.

I ping'd my ip and it works. I have noticed something though: if I go tools -- > options --> database tools --> data conection I see the following:

I was wondering: I checked my work computer and it has the same string there under instance name, but what if I replaced that with sqlexpress?

Yes do all the steps shown in the url i posted from msdn .I am 100% sure one tick marked answer in msdn is the actual solution to your problem.If you go through the attachment you showed me in first reply you will see both problems match .Although you have already done 90% of what has been told in msdn post but i think connection string was skipped by us.Dont forget to reply when you get out of this simple but time consuming problem and mark the post as answered.

where is sqlexpress mentioned in connection string.I think it is written wrong there.it should be sqlexpress instead .

Well it's actually not incorrect. As I said, my work machine seems to have the same configuration and the connection string is the same as the above ((LocalDB)\v11.0) and even so when I connect to the database I can type localhost\SQLEXPRESS. On my machine I also have (LocalDB)\v11.0 under server instance name but as we have discussed, I can't use localhost\SQLEXPRESS but only (LocalDB)\v11.0

can you go to add connection and give me screen shot of that
and what error is it showing now?

the database you are working on you made it in 2012 or earlier version?

i am sure problem lies here only.i can figure it out if you five me screen shot of add connection.

the connection string is the same as the above ((LocalDB)\v11.0) and even so when I connect to the database I can type localhost\SQLEXPRESS.

This is because on that machine, while installing SQL services, you chose the option of installing localdb and sqlexpress. As I mentioned before, both can coexist on the same computer.

you mean a screenshot of this?

No that's not what I meant. As I mentioned before, I don't use visual studio for any type of SQL management.

What I meant was that you can download different versions of SQL and install them on the same computer and they can coexist.

The version of SQL express you download from MS allows you to customize the installation so you can have both localdb enabled as well.

When setting up a PC for dev work, I normally install sql first, then sql management studio then VS without any additional SQL services.

I don't use VS to manage any aspect of my SQL environment. That's just me...

Sorry JeorgeM I was replying to imti321 asking for a screenshot.
Yes I remember what you said but frankly I don't remember what I did in the SQL installation, I don't remember seeing an option to install both localDB and SQLEXPRESS. However, after a bit more research I came across this http://learningsqlserver.wordpress.com/2011/01/21/what-version-of-sql-server-do-i-have/ . This is really important and the reason being that it reminded me that I have installed a single instance, so rather than attempting to connect using localhost\SQLEXPRESS (and various combinations like the one you suggested which was something like .\SQLEXPRESS - sorry can't find the post now) I used only localhost, and it worked :-)!!

SO the problem is soloved now i think .I mentioned in my earlier comment that problem lies their only.If it is soloved the i request to mark it as soloved.

well, yes we could say it is, thanks everybody