I am making a very basic program for a friend of mine that will need a very basic DataBase. I will have about 3 tables at max, I was wondering if it is possible to use access database files easily in C# just like a normal SQL database and if so how? I have seen some tutorials using OLEDB but none really give me a clear way to do things.
It doesn't really go with the Access need but i throw this answer based on the OPs' intention to digg into SQLite.
So i would go for SQLite for its simplicity and efficiency.
See these posts on a very fast and easy way to work with SQLite and Entity Framework:
GETTING STARTED, USING SQLITE WITH .NET
USING SQLITE WITH ENTITY FRAMEWORK 6 AND THE REPOSITORY PATTERN
SQLITE WITH ENTITY FRAMEWORK CODE FIRST AND MIGRATION
Entity Framework 5 on SQLite
Portable databases (II): using SQLite with Entity Framework
Related
I have 2 web applications which are let's say Legacy1 and New1. I have separate DbContext for both applications and separate databases.
Now I want to migrate data from the Legacy1 database to the New1 database. I cannot simply use copy database or export database options in SQL Server. Entities are different and I need to incorporate some logic while migrating data.
I have decided to use .Net Core Console (.Net Framework) project to do this. Do I have to add both DbContexts to this project? Also all the entities which I want to map and do the migration or is there any other way to achieve this.
Finally i found a simple approach to achieve that. I used EF DB First approach to generate edmx files for source and target databases. Which gives me access to corresponding Entities as well.
I Queried source database using source dbcontext and manipulated data as per the requirements and inserted into target database using target dbcontext. I used AutoMapper to map source entities to Target entities.
It was much simpler than i thought earlier. Hope it helps others having similar scenario.
I'm developing an application, in part to learn new technologies - in this instance Entity Framework.
I'm using .NET 4.5, Visual Studio 2013. I need some way to store data that doesn't involve running an SQL server on my tired old laptop (not even the lightweight one) and works with Entity Framework. Ideally I would like something that just stores data in a file. I have a few basic requirements:
A simple relational database. Max 10 tables, this is a prototype, so
the tables won't get very big
Ability to design the database in some
sort of GUI tool
Ability to generate Entity Framework database model
from the DB. I don't want to type those in manually.
No proprietary software other than what I'm already using - i.e. I don't own a MS Access license
Something that ACTUALLY
WORKS
I've spent the better part of today trying to get VS2013 to connect me to an SQLite database that I've created. I never got anywhere. SQLite is simply not listed among the available types of data sources. I've read StackOverflow posts about this issue, I'm done trying to make it work. (this is where the frustration you can sense in this post stems from - this is SO not the point of the exercise, yet I've wasted so much time with it)
Is there any other file based database technology I could use?
Your needs are not compatible, the best choice is SQLite but you can not generate model from database and must use EF as CodeFirst .
and your problem with SQLite can easily fixed by using correct provider and configuration : http://www.bricelam.net/2012/10/entity-framework-on-sqlite.html
I suggest you use SQL Server Compact in combination with my free SQL Server Compact Toolbox VS extension:
A simple relational database. Max 10 tables, this is a prototype, so the tables won't get very big
SQL CE supports all standard relational paradigms, and has a max database size of 4 GB
Ability to design the database in some sort of GUI tool
The extension allows you to do this in Visual Studio
Ability to generate Entity Framework database model from the DB. I don't want to type those in manually.
Yes, fully supported
No proprietary software other than what I'm already using - i.e. I don't own a MS Access license
SQL Compact is free and freely distributable
I am using SQLite with the Entity Framework in a C# Windows Form application. I have chosen to use an in-memory database. I'm trying to load a database file that exists on disk into memory. I'll also need to save what's in memory to the disk.
This seems like a relatively simple task but I can't find an elegant solution to it without hard-coding table creation and updating the queries whenever I change something (I.E: Not feasible)
If anyone can provide assistance, it would be greatly appreciated.
Actually, you may easily use SQLite in-memory database with entity framework.
Look at the following threads as an initial guideline:
In Memory Sqlite Entity Framework Context
Integration Testing Entity Framework code first with in-memory database
I have recently been trying to set up a .Net application which will connect to an oracle database using object relational data types, I would like to do this using the Linq-Sql framework, however when using tools such as DbLinq it does not seem to allow for the object relational data type.
So I was wondering if anyone knows a way to do this?
Thanks,
Alex.
Oracle has been working on, and is now beta-testing, their Entity Framework provider:
ODAC Entity Framework and LINQ Beta has arrived! Itincludes support for Entity Framework, LINQ to Entities, Model-First, Entity Data Model Wizard, and more.
They've even posted a tutorial using Model-First development.
According to their statement of direction, they plan to have this production-ready sometime in 2011.
I've been meaning to test this out but I haven't had the need to in any current projects. It's a shame -- a year or so back I would have really appreciated this ;-)
Let me know how it is!
Im working on an application that needs to talk to a database. The application is written in C#. Im quite taken by LINQ and auto generating classes to represent the database and its tables, so first I considered using SQL as .NET only comes with support for LINQ to SQL. Right now Im leaning more to MySQL mainly because scaling the SQL server might get pricey and because the people within my company are more familiar with MySQL, including me. This is where dbLinq comes in. From what I have read dbLinq works fine for simple queries but might break down on more complicated ones. Could you share your experiences in using dbLinq? Should dbLinq still be regarded as experimental or could I expect to use it without a lot of problems?
Thanks, Bas
Edit:
I read that DbLinq is not able to handle more than one foreign key, can anyone comment on whether this is still the case?
I don't know much about dbsql but check out Entity Framework. It allows you do Linq and can be used with MySQL. Check out this SO question for more info on LinqToEntityFramework for MySQL Using MySQL with Entity Framework
I used EntityFramework to connect to MySQL db in my last project. It is gives some minor issues but reduces amount of effort required to code. I am super impressed with it. I had to do Paging and Filtering in that application. Because of EF this was a piece of cake.
This application had very less data (fraction of millions rows). I would like to know how Entity Framework will do in Applications which has large data.