I've been searching for an example on how to connect to a MySql database and use F# type providers but I could not find anything online.
Can anyone give me a clue? What - if any - extra packages do I need? Do I use SqlDataConnection or SqlEntityConnection.
Excuse my ignorance but I'm totally lost. Any and all help is appreciated. I love the idea of type providers and have a fair amount of experience with functional programing but it's the setup around this that gets me.
I don't think there is out-of-the box type provider that would work with MySQL at the moment. However, Ross McKinlay has been working on a better type provider for SQL databases (more generally). It currently works with MS SQL server and SQL Lite.
It should be possible to write an extension to support MySQL with fairly small amount of work (but sadly, it has not been done yet). See his blog for details. I'm sure that contributions are welcome!
I haven't tested this, but if Entity Framework works with MySql (it does) and if F# has an Entity Framework Type Provider (it does) then I would expect the Entity Framework Type Provider to work with MySql.
Have you tried that approach?
If you are still interested, I recently added support for MySQL to my SQL type provider, help with testing would be good!
A general SQL database type provider, supporting LINQ queries, schema
exploration, individuals and much more besides.
The provider currently supports MS SQL Server, SQLite, PostgreSQL,
Oracle, MySQL and MS Access. All database vendors except SQL Server
and MS Access will require 3rd party ADO.NET connector objects to
function. These are dynamically loaded at runtime so that the SQL
provider project is not dependent on them. You must supply the
location of the assemblies with the "ResolutionPath" static parameter.
https://fsprojects.github.io/SQLProvider/
I think I actually got it to work!! Here's what I did:
Installed the MySql Connector
Added to and referenced MySql.Data & MySql.Data.Entity in my project
Added and EntityFramework 5.0 to my project
Added both MySql.Data & MySql.Data.Entity to the GAC.
Then I was able to use SqlEntityConnection and get the types!
There's gotta be an easier way to do this though. I particular, adding stuff to the GAC should not be a part of all this process. I mean, am I asking to much for this to work pretty much "out of the box"?!
Unfortunately, I'm extremely unfamiliar with .Net yet, so I couldn't get the whole thing working with the App.config file. Based on my searches here, it looks like I'm not the only one having troubles with this. If anyone has any feedback/suggestions please help!
Related
I am using MySQL DB for my android application. I have installed phpmyadmin on my Ubuntu LAMP server and using it to access my DB. Is there any possibilities to access the DB using MS access 2010, as I need to do perform modifications on a regular basis to my DB
If the aim is to change the data and not the structure, using MS access is a good solution, as you can edit anything in linked tables very efficiently with litlle setup efforts.
To achieve this, first you need to download and install the MySQL ODBC driver.
In order to avoid issues, I advise you to install the 32 bit driver, even if you're on a 64 bit system. The 32bit will work flawesly, which is not always the case of the 64 bit.
Once installed, open the ODBC control panel and add an entry pointing to your MySQL database
Then in Access you can add linked tables using this ODBC entry
Once the table are linked, they will behave as if they are MS access tables and you can open them and edit data, and much more.
You can use Microsoft Access as a front-end to your MySQL database.
Refer: MySQL Documentation
But for your case, directly accessing database is wrong. I suggest better you have a view page with php to update DB with proper required validations.
The answer by Thomas G does an excellent job of describing WHAT we need to do, and even provides some good links.
What we need now is a good, step-by-step description of HOW to accomplish all the steps Thomas G describes.
I've been looking for this for a long time, and still no luck. However, I'm possibly on the track of getting that answer, and if I find it, I'll come back here and post it.
I'm using MySQL database in my Ado.Net project. So I am using entity framework model first. It is good but when i want to add "mysql.data" (which i get from mysql web site named mysql data connector) to the Referances, it gives me an error like this: "object reference not set to an instance of an object". When i remove mysql.data from Referances, it works good. I think, it may cause mysq.data. I want to use mysql.data for searching queries. Because i don't know to code searching queries entity framework in my mysql ado.net project.
Could you help me, how do I solve the problem? I want to use both mysql.data and entity framework model first in my project.
Sincerely yours.
Now, I solved the problem. I provided "mysql.data.entity.dll" from MySQL web site, I added to referances and now everything is good.
How could I connect to Embedded MySQL server (libmysqld.dll library) from Delphi XE3? For now I know only one way – use DevArt MyDAC components (specific TMyEmbConnection), but it is paid what is unacceptable for my task now. Try to use dbExpress, but not successful.
So, I have two questions:
1. Can I use dbExpress or any other components from Delphi XE3?
2. Any third-party components (prefer free)?
Thanks
I've used ZeosLib for that in the past.
Worked quite well actually, although really soon it turned out that it was easier to have a central database.
Several people wanted to use the application, and then they wanted to share their changes, and keep things in sync, etc. Luckily, switching to a mysql server was not much more work than copying the data, and changing the connection component parameters.
I am trying to develop an application in the OO way. That is, I intend to design objects for all business components rather than design a form for a process. I am completely new to this.
Anyhow, I discovered InstantObjects and was quite impressed. However, I don't see any code that can help me use MySQL with it.
Has anyone done this before?
Nirav
AFAIK, u can use mySQL ODBC driver, ADO COnnection, InsntanObject ADO Broker to connect mySQL. Don't use DBExpresse since it doenst support mySQL 5.
I'm just starting to look into using LINQ for my database (and XML, and data object!) needs, but need to decide on which database to go with. I've been reading Pro LINQ, and it says that currently, LINQ in .NET 3.5 only supports SQL Server. I have done some googling, and have found references to using LINQ with MySQL and PostgreSQL (my other two DB options), but they are refer to DLinq, which I understand to be the predecessor of LINQ to DB.
I've read interesting and informative comparisons of the three databases here and here, but am still torn. I do not have any in-depth database experience, so it's important to be able to get the software installed and configured easily, or at least be easy to figure out how to compile a list of steps to configure it. I definitely want to have transactional support as well. But most importantly -- I want to use LINQ.
I'd like to hear what everyone here is using, whether it's SQL Server because LINQ supports it natively, or the other two with some additional component for LINQ support that I haven't yet found.
We use devart's dotConnect provider for Linq-to-Oracle and have been very pleased. They try and make the functionality match Linq-to-SQL as close as possible, which seems to be what you're looking for.
They have providers for:
Oracle
MySQL
PostgreSQL
SQLite
SQL Server
From a cost perspective, it's an excellent deal I'd say, just pay for developer seats, no server licensing.