Hi guys, I hope this is the right section to post. I need to develop an application in visual studio 2012 that uses SQL (please bear with me as I'm not very well versed in databases and SQL and therefore I don't know what SQL visual studio uses), and when I attempt to create a new database I get and error, here is the screenshot http://s12.postimg.org/wsxldwwgd/sql.jpg
Now, when I used visual studio 2008 to create a database I used the following options:

Server name:localhost\SQLEXPRESS
Windows authentication
New daabase name: test0

and everything worked OK, but with VS 2012 it looks like it doesn't like SQLEXPRESS.
Does anybody know how to get VS to work with the above options?
Any help or hint will be much appreciated

I normally keep visual studio delegate from SQL express (install and use them separately), but in any case when using a SQL console to connect to the sale press instance on the same machine, you do so by using a "." Not localhost. So it would be like this...

 .\sqlexpress

Thanks, but it doesn't work, http://s17.postimg.org/m30lznb73/sql_Express.jpg
Now, what gets me is that at work I have the same version of visual studio and the same operating system and I can connect to localhost/SQLEXPRESS and at home I can't. I had a look online but I couldn't find out why it is that I can't do the same thing at home? Presumably some piece of software is missing here on my home computer? If it helps, I have installed this today http://msdn.microsoft.com/en-us/jj650015 thinking that it would solve my problem but it didn't

localdb is a minified version of SQL Express that you install via VS.

It uses no management tools outside of VS that I'm aware of. I normally install sqlexpress and use sql management studio to manage SQL. I do this because I use SQL outside of VS.

I'm sure there are a lot of people that use localdb, I don't care for it.

mm does it mean that I can use the same commands for localdb or are they different from SQL express? So, say that I want to use SQL Express (I suppose the reason why I can't connect to localhost/sqlexpress is because there is no sql express on my machine - is that a fair assumption?) can I install it? Is there any specific version I should get? If I install it, will I be able to connect to localhost/sqlexpress?
thanks

Same basic functionality and SQL commands of course. Yes you can install different versions of SQL on the same computer.

You could stay with localdb and if you publish the web application somewhere else you just need to update your connection string(s). Nothing else in your app should change.

In a word, the reason that we get this error message is the client stack could not receive SSRP response UDP packet from SQL Browser. It's easy to isolate the issue. Here are the steps:
1) Make sure your server name is correct, e.g., no typo on the name.
2) Make sure your instance name is correct and there is actually such an instance on your target machine. [Update: Some application converts \ to . If you are not sure about your application, please try both Server\Instance and Server\Instance in your connection string]
3) Make sure the server machine is reachable, e.g, DNS can be resolve correctly, you are able to ping the server (not always true).
4) Make sure SQL Browser service is running on the server.
5) If firewall is enabled on the server, you need to put sqlbrowser.exe and/or UDP port 1434 into exception.

Once you are done the steps, you should not see this error message anymore. You may still fail to connect your SQL server, but error message should be different and you have a different issue now. [Update: If it still fails, you may replace server\instance with tcp:server\instance and/or np:server\instance and see if it succeeds with either TCP or NP protocol. That way, you can isolate the issue a little bit. ]

There is one corner case where you may still fail after you checked step 1)-4). It happens when a) your server is a named instance on cluster or on a multi-homed machine, and b) your client is a Vista machine with Firewall on.

OK I'll try that but I know that the server name is correct. What I'm trying to say here is that on my work machine I didn't have to do any of that, I simply installed VS and connected to the database using locahost\SQLEXPRESS and on my machine I can't do it.I'll definitely check the points you listed imti321 but still it doesn't explain why it doesn't work on my machine.

You could stay with localdb and if you publish the web application somewhere else you just need to update your connection string(s). Nothing else in your app should change.

What if I also install SQL express? WOuld I then be able to use it in place of localdb?

Yes you can install different versions of SQL on the same computer.

OK so what would I need for mine, any idea?

Not sure if I understand. Localdb, sqlexpress, and full versions of SQL server are all fine to use.

My point earlier was that I install SQLexpress because I generally use SQL outside of VS so localdb is to limited for my needs.

Sorry maybe I'm getting confused too. What I was hoping for, was to get sql express to sort out that connection string problem, so that I can connect using localhost\SQLEXPRESS, and I thought that would solve the problem.

If problem is that you cant install it on your home machine then

You need to verify that the SQL Server service is running. You can do this by going to Start > Control Panel > Administrative Tools >
Services, and checking that the service SQL Server (SQLEXPRESS) is running. If not, start it.

While you're in the services applet, also make sure that the service SQL Browser is started. If not, start it.

You need to make sure that SQL Server is allowed to use TCP/IP or named pipes. You can turn these on by opening the SQL Server Configuration Manager
Start > Programs > Microsoft SQL Server
2012 > Configuration Tools, and make sure that TCP/IP and Named Pipes are enabled.

thanks. Just checked, the SQLExpress service is not running, see screenshot:
2f7fbc13da0d06580f586fa9426873ff
Does it mean that it's not installed at all?

Check this out i have even commented on the uploaded file.

make sure all the Sql services are enabled.if they are not enabled you can enable them on same window

Hi, thanks, yes I know what you mean, but I don't know if you saw my screenshot, those services (including any SQLEXPRESS ones) are not there at all, so there is no way I can start them, do you know waht I mean?

Can you tell me do you have vista or windows7 installed .have you already installed vs2012 or it is yet to be installed.Which version of vs is installed in office machine and which windows software is insatalled in office machine on which it dosent show problem.

I am sure you have checked these things
Run SQL Server Configuration Manager.
Go to SQL Server Network Configuration > Protocols for SQLEXPRESS.
Make sure TCP/IP is enabled.

Right-click on TCP/IP and select Properties.
Verify that, under IP2, the IP Address is set to the computer's IP address on the local subnet.
Scroll down to IPAll.
Make sure that TCP Dynamic Ports is blank.
Make sure that TCP Port is set to 1433.

This isn't that difficult. If you haven't installed SQLexpress and you have verified its not running download and install it from Microsoft's site.

You will also want to install SQL management studio as well so you can interact with SQL outside of visual studio.

She is telling she cant install it that is her problem.

All right, so I have installed this http://msdn.microsoft.com/en-gb/evalcenter/dn434042.aspx and now I have all the services needed - I believe - and I have enabled the ones that were disabled, here is a screenshot:
http://s14.postimg.org/rtt873c1t/sql_Services_Updated.jpg
I haven't as yet tried to this as yet:
Make sure TCP/IP is enabled.

"Right-click on TCP/IP and select Properties.
Verify that, under IP2, the IP Address is set to the computer's IP address on the local subnet.
Scroll down to IPAll.
Make sure that TCP Dynamic Ports is blank.
Make sure that TCP Port is set to 1433."

But I tried to give it a go, so I started VS 2012 and tried to connect with the usul string localhost\SQLEXPRESS and this time I got a different error:
http://s9.postimg.org/4q994n4bz/sql_Express_Error.jpg

Ah, I'm on WIndows 7 and visual studio 2012 installed

OK I will try to install the 2012 version instead....will post back

all right, so I removed version 2014 and replaced it with 2012. The services are all running, I have enabled TCP/IP in SQL conf manager, there is only one thing missing that I'm not sure about:

Verify that, under IP2, the IP Address is set to the computer's IP address on the local subnet.

The current IP address on IP2 is 169.254.33.89. I run ipconfig/all on the command prompt I get the below:
http://s21.postimg.org/s1ise3dpz/ipconfig.jpg

So should the IP address under IP2 in sql server conf manager be the same as IPv4 or subnet mask?

in SQL conf manager, there is only one thing missing that I'm not sure about: Verify that, under IP2, the IP Address is set to the computer's IP address on the local subnet. The current IP address on IP2 is 169.254.33.89.So should the IP address under IP2 in sql server conf manager be the same as IPv4 or subnet mask?

I'm not sure why you are doing all of this? Did you read somewhere that you have to make a config change or something?

I've done this a few times and the high level process i have followed is as follows:

1) install sqlexpress
2) install SQL managment studio
3) use sql management studio to connect to sqlexpress on the same computer ".\sqlexpress". localhost would work the same way.
4) install visual studio and choose the options NOT to install SQL components.
5) once visual studio is installed, start developing....
6) in my web app's config file, add a connection string so i can reference the DB anywhere in my web app.

done.

What is the problem you are facing now i think your first problem was
"when I attempt to create a new database I get and error, here is the screenshot http://s12.postimg.org/wsxldwwgd/sql.jpg"
Is that problem soloved if not what is the error it is showing now?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.