ErikEJ / erikej.github.io

ErikEJ blog
3 stars 1 forks source link

Using SQL Server Compact 4 with .NET Core 3.1 (on Windows only) #16

Open ErikEJ opened 3 years ago

bizinbarefeet commented 3 years ago

πŸ‘ Thank you.

DanielRieck commented 3 years ago

Any chance of working with EF Core too?

ErikEJ commented 3 years ago

@DanielRieck That would require someone to sponsor or contribute an update of the EF Core provider to EF Core 3.1 πŸ˜„

ErikEJ commented 3 years ago

@DanielRieck My EF Core 2.2 provider is here: https://github.com/ErikEJ/EntityFramework.SqlServerCompact

ashirafumiiro commented 2 years ago

If I wish to use SQL Server Compact in a class library, do I need to also add the assemblies to the client csproj consuming the library?

Thank you!

ErikEJ commented 2 years ago

@ashirafumiiro yes, you do.

ashirafumiiro commented 2 years ago

Thank you!

On Mon, 13 Dec 2021 at 18:03, Erik Ejlskov Jensen @.***> wrote:

@ashirafumiiro https://github.com/ashirafumiiro yes, you do.

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ErikEJ/erikej.github.io/issues/16#issuecomment-992567675, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNQDSBMYLFA34YAWBMZPHDUQYDK3ANCNFSM4QC6WXJA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

maxshlain commented 2 years ago

Hi @ErikEj, thanks for your incredible work. Do you know if by any chance we can make this working in Linux? I'm currently migrating some enterprise dot net core project from Windows to Linux and they would like to continue using SDF files. They have a nice process of extracting application db from SQL server to CE file for incident investigations and they would like to keep that process with minimum frictions Thanks in advance

ErikEJ commented 2 years ago

@maxshlain thanks for the kind words.

SQL Compact is Windows only, it uses a number of Windows only APIs.

ThePuterMan commented 1 year ago

Struggling to get Sql Compact 4.0 to run with .NET Core 6.0. Any thoughts?

ErikEJ commented 1 year ago

@ThePuterMan I think I need more info than that in order to help! πŸ˜„ - like a repro project

ThePuterMan commented 1 year ago

PS. I have installed EntityFrameworkCore.SqlServerCompact40

ErikEJ commented 1 year ago

@ThePuterMan That wont work! But you can use my EF 6 (Classic) SQLCE provider!

ThePuterMan commented 1 year ago

I think I solved it. I will get back to you if not.

ErikEJ commented 1 year ago

@ThePuterMan Would like to hear more about your actual issue - a good learning opportunity

InteXX commented 1 year ago

@ThePuterMan I also am interesting in knowing more about your scenario and how you solved it.

ErikEJ commented 1 year ago

@InteXX What issues are you facing and what are you trying to do?

ThePuterMan commented 1 year ago

Hi Erik,

As I said before I have fixed the issue by rolling the project back from .NET Core 6.0 to .NET Framework 4.8. The problem was that no matter what I did it refused to recognise SQL Compact.

Regards

David

From: Erik Ejlskov Jensen @.*** Sent: 04 August 2022 07:07 To: ErikEJ/erikej.github.io Cc: ThePuterMan; Mention Subject: Re: [ErikEJ/erikej.github.io] Using SQL Server Compact 4 with .NET Core 3.1 (on Windows only) (#16)

@InteXX https://github.com/InteXX What issues are you facing and what are you trying to do?

β€” Reply to this email directly, view it on GitHub https://github.com/ErikEJ/erikej.github.io/issues/16#issuecomment-1204801162 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AFMWM7PT33IAK75BKNMEBELVXNM2BANCNFSM4QC6WXJA . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AFMWM7LRA552YTEG5EMKTXDVXNM2BA5CNFSM4QC6WXJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOI7H45CQ.gif Message ID: @. @.> >

ErikEJ commented 1 year ago

I will try to update my sample to .net 6

ErikEJ commented 1 year ago

@ThePuterMan @InteXX My sample works fine for me with .NET 6: https://github.com/ErikEJ/SqlCeNetCore/commit/ccbe4107e02bc0d7b36d191420dd59cef3cb1412

InteXX commented 1 year ago

@ErikEJ

What issues are you facing and what are you trying to do?

I'm trying to run SQLCE under EF Core on .NET 6.

I would love to sponsor you but that's not available to me at the present time.

ErikEJ commented 1 year ago

@InteXX I have published an EF6 SQLCE provider - why not just use that? EF Core 6 SQLCE provider is not going to happen from my side.

InteXX commented 1 year ago

@ErikEJ

I have published an EF6 SQLCE provider

Yes, and I love it (thank you!). I've been using it for years. But I'm beginning the process of migrating my projects to EF Core.

For SQLCE-based projects, it looks like I'm faced with a tough decision:

  1. Stick with EF6 (not TEOTWAWKI)
  2. Switch to SQLite (not something to be taken lightly)
  3. Write my own provider (last-ditch option, probably won't happen)
InteXX commented 1 year ago

@ErikEJ

last-ditch option, probably won't happen

That said, if it's not too involved I suppose I might consider giving it a poke (if I had some guidance). Is there much to putting together a provider?

ErikEJ commented 1 year ago

@InteXX that sums it up nicely.

Creating a provider is quite involved.

InteXX commented 1 year ago

@ErikEJ

Creating a provider is quite involved

Aha. I thought so.

ThePuterMan commented 1 year ago

Hi Erik,

My apologies I have rolled the code back to .NET framework 4.8 now so I can’t give you any details of the situation at that time. Basically .NET Core 6.0 just did not like SQL Compact. I had other issues as if seems you cannot use My.Settings with .NET Core and the program has settings that need to be saved. Rolling back seemed the most expedient action.

Kind regards David

From: Erik Ejlskov Jensen @.*** Sent: 27 July 2022 14:44 To: ErikEJ/erikej.github.io Cc: ThePuterMan; Mention Subject: Re: [ErikEJ/erikej.github.io] Using SQL Server Compact 4 with .NET Core 3.1 (on Windows only) (#16)

https://github.com/ThePuterMan @ThePuterMan Would like to hear more about your actual issue - a good learning opportunity β€” Reply to this email directly, https://github.com/ErikEJ/erikej.github.io/issues/16#issuecomment-1196780846 view it on GitHub, or https://github.com/notifications/unsubscribe-auth/AFMWM7I6IUZSUPP4MDR3FRDVWE4IJANCNFSM4QC6WXJA unsubscribe. You are receiving this because you were mentioned. https://github.com/notifications/beacon/AFMWM7L7CKCIW5CSZQKI5ILVWE4IJA5CNFSM4QC6WXJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOI5KW2LQ.gif Message ID: < @.> @.>