1

I'm working on an application which was previously developed with EF, SQL Server, C# and WinForms. For some reasons we need to remove SQL Server and use some and put data in some other container like XML, Excel sheet or in memory classes.

DAL was designed using EF with repository and UOW pattern. Can you please suggest me what can be the best way to migrate and what format will be easy to transfer data?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
haansi
  • 5,470
  • 21
  • 63
  • 91
  • 1
    Do you need to remove the RDBMS entirely, or can you swap SQL Server for another RDBMS? Or do you just need to generate export data? I wouldn't recommend using XML or Excel or anything like that for storage for obvious reasons. I'm keen to learn more here. – Dai Sep 06 '12 at 23:38
  • 1
    Please let us know if it is EF3.5 or EF4 – Andreas Rehm Sep 06 '12 at 23:39
  • @David thanks for attending. Requirment is to remove database entirely. There need to make application independent of DB. – haansi Sep 07 '12 at 00:38
  • *Requirment is to remove database entirely.* What's the reasoning behind this? If it's because SQL Server is high overhead to install and maintain you might want to look at SQL Server LocalDB. – ta.speot.is Sep 08 '12 at 08:30

2 Answers2

1

Since the data access is decoupled into a repository you should be able to write a new repository instance that will allow you to retrieve your data in its new format. Specifically if you wanted to hold the data in XML you could just write a new repository that uses Linq-to-XML to retrieve your data.

I don't know of a good quick way to transfer your data from SQL Server into XML. If I were doing it I'd probably write some custom application to make the conversion, but I suspect there are better solutions out there for this type of migration.

Narthring
  • 1,124
  • 18
  • 32
1

Your question duplicates this questions:

There seems to be a provider for virtuoso xml:

Some hints can be found here:

EF ist basically developed for database abstraction. You will need to write your own xml database provider if you try to strore XML instead.

Your options are:

  • move to SQL compact (but not in XML)
  • use XPath and rewrite your code
  • use Xpath for your own database provider

Be aware that your xml file size and speed depends on the amount of data! Using multiple xml files can end up in a mess.

Community
  • 1
  • 1
Andreas Rehm
  • 2,222
  • 17
  • 20