Can't get SQL Server CE toolbox to work in Visual Studio 13 - sql

I've got a new instance of VS2013 and I'm trying to set up a SQL Server CE instance to test against.
I can't seem to even get started. I've installed the SQL Server CE Toolbox plugin, and when I open it all I get is a message that says
The database has been created by an earlier version of SQL Server Compact. Please upgrade using SqlCeEngine.Upgrade() method
What database?
If I try and "Remove Broken Connections" I get a dialog with the same error message.
If I try and connect to an existing Northwind.sdf test connection works but when I say "OK" I get a dialog that says "Please tell ErikEJ about this problem"

Rename/delete the files named SqlCe35AddinStore.sdf and SqlCe40AddinStore.sdf located in C:\Users\your name\AppData\Local (%appdata%).
Also make sure you have either SqlCe 4.0 or 3.5 properly installed.
The issue here was that the 3.5 installtion was broken, I will also attempt to improve the check for the precense of 3.5

Related

Getting Error in opening .mdf Database in asp.net application

I am getting this error while accessing database :
The database 'E:\WORKSPACE\xxx\xxx\APP_DATA\xxxxxxxxxx.MDF' cannot be opened because it is version 852. This server supports version 782 and earlier. A downgrade path is not supported.Could not open new database.
Actually, i have copied the complete solution from one system to other and trying to run it but getting the above error. All DLL and all References are added correctly.
I also installed SQL Server 2017 Express Edition on my system still setting the error.
Please guide me to the solution for this.
Thanks,
Ashwin

LinqPad Error: Unable to find the .Net Framework Data Provider

I am new to LinqPad.
I downloaded a .sdf file from the internet (i know what it is) I wanted to view its tables. So I googled "how to read .sdf files" and came across Linqpad, which I installed.
When I browse to my .sdf file from LinqPad and try to open it as a connection, I get the message "Unable to find the requested .Net framework data provider, it may not be installed"
Does this mean i need to install SQL CE before using LinqPad? I assumed LinqPad was the program to view tables, run queries, etc and that I did not need the original db program.
Please advise on what the error refers to and best way to resolve. thanks
To answer your question, yes you do have to install it. I just ran across this problem while trying to connect to a Sql CE 3.5 DB in LinqPad. You have to have the proper version installed first. I only had 4.0 installed and was trying to connect to a 3.5 DB. So had to use the SSCERuntime msi found here to install the items shown below:
Just go to that link and download it somewhere and then run the msi(s).
Note the following:
It is mandatory to install both the 32-bit and the 64-bit version of
SQL Server Compact MSI files on a 64-bit Computer. Installing only the
32-bit version of the SQL Server Compact 3.5 SP2 MSI file on a 64-bit
computer will lead to failure of the existing SQL Server Compact 3.5
applications on the Computer.
So just follow the instructions shown in the "Install.txt" that is downloaded with the msi's.
After installing them I had to close and reopen LinqPad and then the connection worked.
I'll add a variant on Kasper's solution. For the case of connecting to SQL CE 4, I appeared to already have the SQL CE4 runtimes installed yet I still got the same error.
Trying to install the latest SQL CE 4 from Microsoft reported that a newer version was already installed and aborted the install.
Uninstalling the "newer version" and then installing the latest download fixed the problem for me.
I'm not sure how I got that original version, that's "newer" than the latest from Microsoft. Possibly from an older Visual Studio install.
You first need to make a connection to your database. You can do that by clicking "Add Connection", "Default Linq to Sql connection" and then marking your version of SQL CE on top and providing the information.
LinqPad is not just viewing tables, run queries etc. It is much more than that.

Error in Connect to the Access Database In Vb.net [duplicate]

I have a Visual Studio 2008 solution with two projects (a Word-Template project and a VB.Net console application for testing). Both projects reference a database project which opens a connection to an MS-Access 2007 database file and have references to System.Data.OleDb. In the database project I have a function which retrieves a data table as follows
private class AdminDatabase
' stores the connection string which is set in the New() method
dim strAdminConnection as string
public sub New()
...
adminName = dlgopen.FileName
conAdminDB = New OleDbConnection
conAdminDB.ConnectionString = "Data Source='" + adminName + "';" + _
"Provider=Microsoft.ACE.OLEDB.12.0"
' store the connection string in strAdminConnection
strAdminConnection = conAdminDB.ConnectionString.ToString()
My.Settings.SetUserOverride("AdminConnectionString", strAdminConnection)
...
End Sub
' retrieves data from the database
Public Function getDataTable(ByVal sqlStatement As String) As DataTable
Dim ds As New DataSet
Dim dt As New DataTable
Dim da As New OleDbDataAdapter
Dim localCon As New OleDbConnection
localCon.ConnectionString = strAdminConnection
Using localCon
Dim command As OleDbCommand = localCon.CreateCommand()
command.CommandText = sqlStatement
localCon.Open()
da.SelectCommand = command
da.Fill(dt)
getDataTable = dt
End Using
End Function
End Class
When I call this function from my Word 2007 Template project everything works fine; no errors. But when I run it from the console application it throws the following exception
ex = {"The 'Microsoft.ACE.OLEDB.12.0'
provider is not registered on the
local machine."}
Both projects have the same reference and the console application did work when I first wrote it (a while ago) but now it has stopped work. I must be missing something but I don't know what. Any ideas?
Basically, if you're on a 64-bit machine, IIS 7 is not (by default) serving 32-bit apps, which the database engine operates on. So here is exactly what you do:
1) ensure that the 2007 database engine is installed, this can be downloaded at:
http://www.microsoft.com/downloads/details.aspx?FamilyID=7554F536-8C28-4598-9B72-EF94E038C891&displaylang=en
2) open IIS7 manager, and open the Application Pools area. On the right sidebar, you will see an option that says "Set application pool defaults". Click it, and a window will pop up with the options.
3) the second field down, which says 'Enable 32-bit applications' is probably set to FALSE by default. Simply click where it says 'false' to change it to 'true'.
4) Restart your app pool (you can do this by hitting RECYCLE instead of STOP then START, which will also work).
5) done, and your error message will go away.
I have a visual Basic program with Visual Studio 2008 that uses an Access 2007 database and was receiving the same error. I found some threads that advised changing the advanced compile configuration to x86 found in the programs properties if you're running a 64 bit system. So far I haven't had any problems with my program since.
Are you running a 64 bit system with the database running 32 bit but the console running 64 bit? There are no MS Access drivers that run 64 bit and would report an error identical to the one your reported.
Solution:
That's it! Thanks Arjun Paudel for the link. Here's the solution as found on XNA Creator's Club Online. It's by Stephen Styrchak.
The following error suggests me to believe that you are compiling for 64bit:
The 'Microsoft .ACE.OELDB.12.0' provider is not registered on the local machine
I dont have express edition but are following steps valid in 2008 express?
http://forums.xna.com/forums/t/4377.aspx#22601
http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/ed374d4f-5677-41cb-bfe0-198e68810805/?prof=required
- Arjun Paudel
In VC# Express, this property is missing, but you can still create an x86 configuration if you know where to look.
It looks like a long list of steps, but once you know where these things are it's a lot easier. Anyone who only has VC# Express will probably find this useful. Once you know about Configuration Manager, it'll be much more intuitive the next time.
1.In VC# Express 2005, go to Tools -> Options.
2.In the bottom-left corner of the Options dialog, check the box that says, "Show all settings".
3.In the tree-view on the left hand side, select "Projects and Solutions".
4.In the options on the right, check the box that says, "Show advanced build configuraions."
5.Click OK.
6.Go to Build -> Configuration Manager...
7.In the Platform column next to your project, click the combobox and select "<New...>".
8.In the "New platform" setting, choose "x86".
9.Click OK.
10.Click Close.
There, now you have an x86 configuration! Easy as pie! :-)
I also recommend using Configuration Manager to delete the Any CPU platform. You really don't want that if you ever have depedencies on 32-bit native DLLs (even indirect dependencies).
Stephen Styrchak | XNA Game Studio Developer
http://forums.xna.com/forums/p/4377/22601.aspx#22601
I thought I'd chime in because I found this question when facing a slightly different context of the problem and thought it might help other tormented souls in the future:
I had an ASP.NET app hosted on IIS 7.0 running on Windows Server 2008 64-bit.
Since IIS is in control of the process bitness, the solution in my case was to set the Enable32bitAppOnWin64 setting to true:
http://blogs.msdn.com/vijaysk/archive/2009/03/06/iis-7-tip-2-you-can-now-run-32-bit-and-64-bit-applications-on-the-same-server.aspx
It works slightly differently in IIS 6.0 (You cannot set Enable32bitAppOnWin64 at application-pool level)
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/0aafb9a0-1b1c-4a39-ac9a-994adc902485.mspx?mfr=true
I'm having same problem. I try to install office 2010 64bit on windows 7 64 bit and then install 2007 Office System Driver : Data Connectivity Components.
after that, visual studio 2008 can opens a connection to an MS-Access 2007 database file.
See my post on a similar Stack Exchange thread https://stackoverflow.com/a/21455677/1368849
I had version 15, not 12 installed, which I found out by running this PowerShell code...
(New-Object system.data.oledb.oledbenumerator).GetElements() | select SOURCES_NAME, SOURCES_DESCRIPTION
...which gave me this result (I've removed other data sources for brevity)...
SOURCES_NAME SOURCES_DESCRIPTION
------------ -------------------
Microsoft.ACE.OLEDB.15.0 Microsoft Office 15.0 Access Database Engine OLE DB Provider
I've got the same error on a fully updated Windows Vista Family 64bit with a .NET application that I've compiled to 32 bit only - the program is installed in the programx86 folder on 64 bit machines. It fails with this error message even with 2007 access database provider installed, with/wiothout the SP2 of the same installed, IIS installed and app pool set for 32bit app support... yes I've tried every solution everywhere and still no success.
I switched my app to ACE OLE DB.12.0 because JET4.0 was failing on 64bit machines - and it's no better :-/ The most promising thread I've found was this:
http://ellisweb.net/2010/01/connecting-to-excel-and-access-files-using-net-on-a-64-bit-server/
but when you try to install the 64 bit "2010 Office System Driver Beta: Data Connectivity Components" it tells you that you can't install the 64 bit version without uninstalling all 32bit office applications... and installing the 32 bit version of 2010 Office System Driver Beta: Data Connectivity Components doesn't solve the initial problem, even with "Microsoft.ACE.OLEDB.12.0" as provider instead of "Microsoft.ACE.OLEDB.14.0" which that page (and others) recommend.
My next attempt will be to follow this post:
The issue is due to the wrong flavor of OLEDB32.DLL and OLEDB32r.DLL being registered on the server. If the 64 bit versions are registered, they need to be unregistered, and then the 32 bit versions registered instead. To fix this, unregister the versions located in %Program Files%/Common Files/System/OLE DB. Then register the versions at the same path but in the %Program Files (x86)% directory.
Has anyone else had so much trouble with both JET4.0 and OLEDB ACE providers on 64 bit machines? Has anyone found a solution if none of the others work?
I am assuming that if you are running a 64 bit system with a 32 bit database and trying to run a 64 bit console, the following packages need to be installed on the machine.
Install the Microsoft Access Database Engine 2010 x86
Redistributable, this installation is available at:
http://www.microsoft.com/download/en/details.aspx?id=13255 .
Data Connectivity Components of Office 2007, this installation is
available at:
http://www.microsoft.com/download/en/confirmation.aspx?id=23734 .
Microsoft Access Database Engine 2010 x64 Redistributable. You will
need to download the package locally and run it with a passive flag.
You can download the installation here:
http://www.microsoft.com/en-us/download/details.aspx?id=13255
Installing using the command prompt with the '/passive' flag. In the
command prompt run the following command:
'AccessDatabaseEngine_x64.exe /passive'
Note: The order seems to matter - so if you have anything installed already, uninstall and follow the steps above.

Visual Studio Unable to Add Data Connection to SQL Server

Im trying to add my local SQL Server database to Visual Studio so I can grab the connection string from it but I am getting this error message:
As you can see the Test succeeds but when I try to add I receive error.
I figured out that you need to have SDK.sfc 11.0.0.0 installed. I only had 10.0.0.0 installed.
You can use the link here to download "Microsoft® System CLR Types for Microsoft® SQL Server® 2012" and "Microsoft® SQL Server® 2012 Shared Management Objects"
Download Link
I think these are normally installed with VS 2012 but in either case it fixed the issue. You can check your version in the assembly path:
C:\windows\assembly
The install does not require a restart but you will need to close and reopen your Visual Studio.
It seems that you are missing some updates from Microsoft: one link
You could search with google/bing/whatever and find a lot of hints to get this working!
for both type (32 bit or 64 bit )
Open URL http://www.microsoft.com/en-us/download/details.aspx?id=35580
Download ENU\x86\SQLSysClrTypes.msi
Download ENU\x86\SharedManagementObjects.msi
Install ENU\x86\SQLSysClrTypes.msi
Install ENU\x86\SharedManagementObjects.msi
Restart your Visual Studio and now Everything will work smooth.
This fix was for the error (version 11.0.0.0)

Visual Studio error when trying to open dbproj files

I have Visual Studio 2008 Database Edition, and everything worked great until the first time I tried to load a .dbproj file. These database project files work for the other developers I work with, but when I try to open it, I just get an error message "Object reference ot set to an instance of an object."
It's probably the same problem this guy is having, although he didn't do a good job of describing it and has no solution.
Every other kind of project file loads and builds and runs normally. dbproj files all generate this cryptic error. I just tried a fresh removal and reinstall of Visual Studio 2008 DE to no avail. Could this have something to do with my SQL 2005 installation? (This also works normally through SQL Server Management Studio.)
**
UPDATE
**
Probably even more importantly, this same error occurs when I try to make a new dbproj file. Every other type of project can be created no problem.
You need to tell Visual Studio the correct instance of SQL Server to use for validation.
Tools>Options>DatabaseTools
Change the settings in "Data Connections" and "Design-time Validation Database" to reflect the correct instance.
After many failed re-configurations and re-installations, a member of my team discovered the problem!
Under Tools > Options > Database Tools > Design-time Validation Database, there is an option to set your SQL Server Instance Name. Visual Studio automatically picks this when it's installed.
The key is that Visual Studio doesn't necessarily pick the right one. I happen to have 3 SQL server instances on my machine. SQLEXPRESS (a 2005 instance that Visual Studio installed alongside itself), SQLEXPRESS2005, a 2005 instance I installed, and SQLEXPRESS2008, which I also installed.
Visual Studio had configured itself to connect to the SQLEXPRESS2008 instance, even though it only supports SQL2005 dbproj files by default. By opening this dialogue, and updating the server instance name, the error no longer appeared and I was able to open dbproj files: