SQL Server CE 4 DataProvider not available in server explorer - c#

I have installed the sp1 for visual studio 2010 and installed sql server ce 4 runtime. But still not able to create connection to the sql ce database using standart data provider.
This is how my Select DataProvider Dialog looks like now.
P.S.
Does not know if it matters, but I have tested this with console application and winforms application both targeted at .Net 4.0

You must install the SQL Server Compact 4 tools via Web PI, as described here: http://erikej.blogspot.com/2010/12/visual-studio-tools-for-sql-server.html

You can use this project/Tool to open/create sql ce databases:
SQL SERVER CE QUERY TOOL
And have a look at this:
Everything SQL Server Compact
Regards

Another option, just install the extension SQL Server Compact & SQLite Toolbox
from here http://sqlcetoolbox.codeplex.com or over VS Add Extension.

Related

Installing MSSQL for Windows 7 and running application made with MSSQL2016 for X86 systems

I'm developing an ERP via Windows Form Application using (C# and SQL) through Visual Studio 2017 and MSSQL SERVER 2016 (VERSION 852) on a 64 bit Machine with Windows 8.
On deploying the application on the X64 machine with SQLLOCALDB (VERSION 852 or above) installed, the application is working fine.
But, I want to distribute the application in my circles having old machines with X86 (32 bit) architecture. The application is getting installed, but on launching the application, the form with DATABASE CONNECTIVITY is creating a problem.
"The database 'MyFirstWFAAPP' cannot be opened because it is version
852. This server supports version 851 and earlier. A downgrade path is not supported. Could not open new database 'MyFirstWFAAPP'. CREATE
DATABASE is aborted. Cannot attach the file
'C:\devx\2018\MyFirstWFAAPP\App_Data\MyFirstWFAAPP.mdf' as database
'MyFirstWFAAPP'. "
PS: Installation of MSSQL SERVER (Local DB) to 32 bit machines, WINDOW 7, has been deprecated by Microsoft (As I've been informed) So, MSSQL SERVER 2016 and above cannot be installed onto Window 7 systems.
Window 7, XP Support SQL SERVER installation either or below SQL SERVER 2008 R2 (VERSION 660/661).
I'm in a dilemma, as I'm have no idea of what to do.
1) Is there any way, we can convert Code of SQL SERVER 2016 to SQL SERVER 2008 (R2) or below??
2) or, should I delete the MSSQL Server 2016 and then install the 2008 editions.
3) or, should I install SQL 2008 on the parallel with SQL SERVER 2016 running. and, also install MSSQL Server Management Studio and choose the targeted versions of MSSQL. (I'm not sure, whether it's possible. Just guessing).
Please support. As, I'm worried.
Thanks and Regards!
Narayan
This has nothing to do with the target platform (x86 vs. x64). This is simply an issue of targeted SQL Server version. SQL Server knows how to upgrade a database file, but there is absolutely no way it can downgrade one. You are distributing a SQL Server 2016 database file (internal version 852), this will only be opened by the SQL Server 2016 or SQL Server 2017.
But the real problem is different. The real problem is that you are distributing the database as an artifact. This is an absolute NO. Just think how will you distribute the next version of your app, your MDF will replace the actual data that was updated by your 'circles'. You must change your application to distribute only scripts for creating and upgrating database. Your framework of choice may well already provide a solution.

Service based database vs SQL Server Compact vs LocalDB?

My goal is to create a stand-alone C# Windows form application with 2-3 tables that will be installed on client machine with a installer file. And I don't want to install SQL Server 2008 software on client machine, I'm using Visual Studio 2013 C# for development.
My options are SQL Server Compct 4.0 but I don't see Visual Studio 2013 has inbuilt support for that, when I add new item to project I don't see Compact (.sdf) file option there.
I've installed third-party SQL Server Compact Toolbox so I can create .sdf file and connectivity but I believe Microsoft is not giving support for compact db now.
I can see service-based database (.mdf) file which is actually a LocalDb\\ something.
So what should I use if I don't want to install SQL Server 2008 on client but want to have db
at client software?
You should mostly base your choice on your target platforms and the level of SQL Server functionality you expect.
Target Platforms:
LocalDB does not support older versions of Windows (e.g. Windows XP) or WoW. Toad World's LocalDB overview has a good breakdown of its target-platform restrictions.
SQL Server Compact Edition has very few target-platform restrictions. Check out its download page under "System Requirements" for specifics.
Functionality:
LocalDB better approximates SQL Server Express functionally. SQL Server Compact Edition has many functional limitations (e.g. no support for stored procedures).
MSDN's introductory overview of LocalDB explains many of the important functional differences between LocalDB and SQL Server Compact Edition; and the aforementioned Toad World LocalDB overview explains some of what (not) to expect from LocalDB functionally too.
Redistribution:
Both SQL Server Compact Edition (per the "Additional Information" section of its download page) and LocalDB (per SQL Server forums) are freely redistributable: so you should be okay with either with respect to fine print.
maybe SQLite would be an option? check out: http://www.sqlite.org/
it's just a DLL/Assembly you need to reference and it's pretty straightforward..

Sql server compact for windows app using visual studio 2010

I am working on windows app where i need to use sql server compact . I tried various articles for using it in visual studio 2010
Private Installation for SQL Compact
Working with SQL Server Compact in Visual Studio
but didn't get any satisfactory answers .Please suggest me best solution available for this .
If you use the nuget package (http://nuget.org/) you can simply look it up and install it. Otherwise you just copy the sql server compact dll's to your exe directory and include System.Data.SqlServerCe.dll
There are various different ways to interface with a database. As an OO framework .net has various abstractions for database access. The main ones are (vanilla) ADO.NET (not recommended), EntityFramework, nHibernate and LinqToSQL (not recommended). They will all work with SQL CE very well.
Given what you have described so far I would recommend EntityFramework CodeFirst SQL CE. Scott Gu has a good blog on an old version of this tech. I would start by just installing the premade nuget for SQL CE EF.

One way Sync b/w Sql Server 2008 & SQL CE 4.0 (WPF)

I am planning to use the sync framework to sync data between sql server 2008 & sql CE 4.0.
This is uni directional- only from sql server -> sql CE .
Updates will directly go to SQL Server 2008.
Microsoft is stating there is no Sync support for SQL Server -> SQL CE 4.0.
Can you guide me on how to achieve syncing from sql server 2008 - SQL CE 4.0.
You can use Sync FX with SQLCompact 4.0 - http://jtabadero.wordpress.com/2012/04/20/sync-framework-and-sql-compact-4-yes-you-can/ or you can use RDA with 4.0 - http://erikej.blogspot.com/2011/03/snapshot-synchronization-with-sql.html

Database connection fails

I have written c# application that uses mdf file for database.when i make setup of that project and runs on other computer having dotnetframework and sql server compact 3.5 then id dose not runs and exception is shown saying something sql server not found or not ready for connection something like that what should i do
mdf is not for sql server compact edition, it is for the real sql server. You need to deploy it to Sql Server Express edition or higher.
Edit:
You can install SQL server express edition or if you want to use the sql compact server you need to create a "local database" in visual studio.
When adding a mdf-database to your visual studio project is is attached to your local sql express database server behind the scenes when you start your project.

Categories