Can't find servers in Data Connection in Visual Studio 2012? - database

http://msdn.microsoft.com/en-us/data/jj193542
I'm following the tutorial in the link above, and when I get to the step "Connect to either LocalDb ((localdb)\v11.0) or SQL Express (.\SQLEXPRESS), depending on which one you have installed" in the "Where's my data" section, the server name drop down is blank. I have LocalDB installed, and the program is writing to a database since following the previous steps of the tutorial I created two tables that were saved, but for some reason I can't add a connection to any server in Database Explorer.
I'm using Visual Studio 2012 Express for Desktop.

If it's blank it means you never set it up before so add it manually, if you are not sure what to put as the server name you can try .

Related

How do I create an SQL Server?

I have a very fundamental and basic SQL question. Using Microsoft SQL Server Management Studio Express, how do I create my first Server? For that matter, how would I create it using any other required software tool?
I took a look at Sql Server Configuration Manager and I saw SQLEPRESS running as a SQL Server. But when I added that in to the start up widow for MSSM Studio Express, as the server name, it threw an error saying it cannot be found or does not exist. It seems that this is not the right kind of server.
To connect to the local instance of SQLEXPRESS, you will need localhost as the server name.
This is a fairly comprehensive guide on how to create a database once you have connected. All the steps won't apply to using SQL Express, but the gist of it is there.
In Object Explorer, connect to an instance of the SQL Server Database
Engine and then expand that instance.
Right-click Databases, and then
click New Database. In New Database, enter a database name.
To create
the database by accepting all default values, click OK; otherwise,
continue with the following optional steps.
Based on this comment:
Trying .\SQLEXPRESS in SQL Server Management Studio Express throws an error that says that "This version of Microsoft SQL Server Management Studio Express can only be used to connect to SQL Server 2005 servers". So this is the problem, I think.
.\SQLEXPRESS is the correct server name, but you have the wrong version of client tools (SQL Server Management Studio). To find out the version of SQL you are connecting to, there are a number of suggestions here: https://www.mssqltips.com/sqlservertip/1140/how-to-tell-what-sql-server-version-you-are-running/
But since you can't connect yet the easiest thing to do is go searching for sqlserver.exe, right click, properties, version. If you have multiple version you need take note of the folder that it's in and check the SQLExpress one. You can also check in services.
Once you've worked out the version, download and install just the management tools for that version.

Connections to SQL Server database files (.mdf) require LocalDB or SQL Server Express to be installed and running on the local computer

I am using Visual Studio 2015 professional. When I tried to add Service-based Database to my project I got this error.
Connections to SQL Server database files (.mdf) require LocalDB or SQL Server Express to be installed and running on the local computer. You may need to modify the setup and ensure Microsoft SQL Server Data Tools is selected and install the current version at: http://go.microsoft.com/fwlink/?Linkid=125883
I also have Microsoft SQL Sever 2014 installed on my computer.
really need help.
Just in case it helps others, I recently received this error in Visual Studio. The error states to go to http://go.microsoft.com/fwlink/?Linkid=125883. When going to this URL, it now redirects to https://www.microsoft.com/en-us/server-cloud/products/sql-server/. The new URL do not seems to have an obvious instructions on how to get Microsoft SQL Server Data Tools. Here is what worked for me.
In Visual Studio, select Tools > Extensions and Updates
In the Extensions and Updates pop-up box, select Installed > Updates
Highlight Microsoft SQL Server Update for database... and click the Update button. If Microsoft SQL Server Update for database... is not listed, you can download SSDTSetup.exe from https://msdn.microsoft.com/en-us/mt186501. 
Your default Web browser will prompt a download of SSDTSetup.exe
In your Downloads folder, run SSDTSetup
Follow the prompts of the installer
After doing this, just to play it safe, I restarted Visual Studio. This might not be necessary. I then did the following in Visual Studio.
In Visual Studio, if you do not already have a folder named App_Data, in the Solution Explorer panel, right-click the name of your site and select Add > New Folder. Name the new folder App_Data.
With the App_Data folder highlighted, press Ctrl + Shift + A (or right-click and select Add > New Item)
In the Add New Item pop-up box, select Visual Basic or C# > Data > SQL Server Database. Click Add.
The error should not appear, and in Solution Explorer should now be a file named database1.mdf.
Just do this. On Visual Studio, go to Tools > Options > Database Tools > Data Connections. Here clear the "SQL Server Instance Name (blank for default)" option and write SQLEXPRESS
The error message is quite clear. You need to have either LocalDB or SQL Server Express installed and running on the local computer, and you apparently don't.
Do as the error message instructs, go to the link provided in that error message, select Microsoft SQL Server Data Tools, and install the latest version.

Visual Studio 2013 crashes when building connection string to microsoft sql server

I am trying to migrate my application from mysql to microsoft sql server 2014. When I create a new application and attempt to build a connection string to a microsoft sql server 2014, I can test the connection and it returns an successful connection but vs2013 crashes when I click the OK button. This process works on the mysql connection I have on another application so I suspect it is looking at a bad reference to the sql-server dll. I have looked everywhere and there is no reference to this problem.
This is exactly the same problem as this post
Microsoft Visual Studio 2013 Stopped Working when adding connection but user, B413, never post a fix to his problem
I found a work around for this problem. It's not pretty but it works.
Go to Server Explorer and right click on data connections
Select "Create a new SQL database"
Click the down arrow for the server name and select your sql server
Give your database a name like "test"
This will create a new database in the sql server
Now go and right click on the new instance of your new database in server explorer and chose "Modify Connection"
Now click the "advanced" button
Now scroll down to the Source section and change the name of "Initial Catalog" to the database you wish to connect to.
Ok out of everything and you should be able to see your tables.
Go the Sql Server and delete the instance of the new database you created for this exercise.
Good Luck...I hope this helps.
For me the solution was to (temporarely) remove the MySQL DataProvider entry in the registry as explained here. Hope it helps others!

How to fix Visual Studio's error "This server version is not supported..." for SQL Server 2012

I recently installed Visual Studio 2010 and SQL Server 2012 on a Windows Server 2008 R2 machine - (including all updates/Service Packs).
When attempting to work on a SQL Server database from within Visual Studio, VS throws the following error:
This server version is not supported. Only servers up to Microsoft SQL
Server 2008 are supported
I recall getting this same error a while back (on a different computer) when I updated a SQL Server 2008 instance to SQL Server 2008 R2. The fix, back then, was to install (or reinstall) Visual Studio 2010 SP1.
Now that I'm receiving this error again (on a new computer), I thought it reasonable to reinstall VS SP1 just like I did a while back. However, doing so did not fix the problem.
It appears as though Visual Studio may need another update to support SQL Server 2012 instances.
For clarity, here are the steps that I did to produce the error: (using VS 2010sp1 and SQL2012)
Using VS, create a Windows Forms application
Right-click the project and choose, Add > New Item
Select "Service-based Database"
Cancel out of the "Data Source Configuration Wizard"
A Database will appear under your Project in Solution Explorer. Double-click the new database
The Database will be added to Server Explorer's list of Data Connections
In Server Explorer, open the database, right-click the Tables directory, then select "Add New Table"
The error "This server version is not supported...." is thrown
Screenshots for whatever its worth..
My question is, is there a fix for this? If so, what is it?
Maybe get SQL Server Data Tools, which work with SQL Server 2012? I believe there are some good tutorials and other materials in the Developer Training Kit. I don't think there are any tricks yet to make an older version of Visual Studio / Data Dude compatible with SQL Server 2012.
Following MSDN blog link discusses about the issue that you are facing with local SQL Server database instance in Visual Studio 2010.
Using LocalDB in Visual Studio 2010
My problem was that I couldn't get VS2012 to work right with SQL Server 2012. I installed the latter product first, but after installing VS2012 and attempting to open an existing project, my existing data file just would not work. I know the software is supposed to automatically take you through a wizard to update your database in the project, but that didn't happen, and I couldn't find a way to make it happen. I'm on the point now of getting rid of SQL Server 2012 and going back to 2008. I'd rather use the most current releases, but I can't spend any more time on configuration issues.
I tried reinstalling the SSDT as well, but kept getting the same error you mentioned Jed, this seemed to let me get around the error message:
http://forums.asp.net/t/1721552.aspx/1?Working+with+Denali+SQLEXPRESS+in+VS+11+Database+issue
This error could also occur if you use the wrong provider. A recently came across the "This server version is not supported...." error and after changing the provider from sqlClient Data Provider to SQL Server Native Client 11.0 in the connection string for the Data Source configuration the problem was solved.
For me, the error arises whenever I try creating a new database. So after unsuccessfully attempting all methods advised, I bypassed the error by clicking on "Add connection" and putting my server name in the dialog box. After adding the non-existent database name, it notifies that it can't find such database and asks whether to create it. Voila! Database created (even though server version is supposedly unsupported).

SQL Server 2005 Express successfully installed, but is nowhere to be found!

I've SQL Server 2008 Express installed. I've just download and installed SQL Server 2005 Express, but I changed the name of instance into SQLEXPRESS2005 (I added 2005 at the end to avoid conflicting names).
Unfortunately, when I try to access the 2005 instance either using the SQL Server Management Studio or the VWD 2008 Express (Database Explorer window), I don't see it.
I just disk-recovered my system, so I lost many of my files. But, before that, I had both versions, one having 2005 as instance name.
So here are the summary of the issues:
I was able to download and install successfully the Express 2005
When I try to connect to a server, I only see.\SQLEXPRESS as option (there's no SQLEXPRESS2005)
When I try to connect from the VWD, I get the Server not found ERROR!
I can see the SQL SERVER 2005 icon on the Control Panel window. But, when I try to
uninstall it, I get a error message telling that this program is not found
When do Start -> All Programs, I can see the The Microsoft SQL Server 2005 folder
It's really strange as I was successfully able to install both versions before I experienced problem with my system.
Thanks for helping.
Do you see the service for the SQLEXPRESS2005 instance? If it isn't there then the instance doesn't exist and you'll need to reinstall.

Resources