I'm trying to set up a local database on my Mac using VS Code for development purposes. I have installed MariaDB via homebrew, and I can access it through the terminal and play around with it.
But how do I get the connection-string to put in to VS Code, so when I'm using Entity Framework Core, it will automatically create the tables in the MariaDB database?
Check the DB provider in :
https://learn.microsoft.com/en-us/ef/core/providers/?tabs=dotnet-core-cli
It mention the MariaDB connector as the same as MySQL, using Pomelo.EntityFrameworkCore.MySql, available in Nuget
you can start a project and then add :
dotnet add package Pomelo.EntityFrameworkCore.MySql
Like described in this pretty straight forward tutorial :
https://www.jerriepelser.com/blog/using-mariadb-with-aspnet-core/
Have fun
Related
I'm trying to set up my environment for developing asp.net vNext + Entity Framework 7 on my OSX.
Apparently, there is no provider for MySQL neither PostgreSQL yet. Thus, what can be used as database for developing on OSX?
What you folks have been doing for develop asp.net vNext on OSX? Or should I set up a Windows VM?
Any suggestion?
I've got even an open issue on Github on this topic.
Cheers
We will have a PostgreSQL and/or MySQL provider for EF7 (either delivered by our team or we'll work with a provider writer to help them build it). Work hasn't started on them yet though.
We haven't been focusing on EF7 on Mono at this stage, so there are likely some rough edges. We do have some folks who have successfully used it to connect to a remote SQL Server though.
To date, no RDBMS is supported on OSX for EF7.
Since (LocalDB)\v11.0 doesn't allow remote access and run on OSX/LNX, I've setup a SQLServer2012 Express and SQLServer 2012 Standard Edition hosted on a local Windows VM to establish a remote DB connection from my Visual Studio Code project.
From Visual Studio Code running on OSX, EF7 fails to successfully connect and interact with those local SQL Servers. In this instance, I was using the ASP.NET 5 Music Store example project: GitHub Source
Oh, and with all the SSL requirements, AZURE SQL Server is out of the question as an option.
Microsoft is heading in the right direction, we'll get there, but you're dealing with bleeding edge EF7 at the moment which is a complete reengineering from EF6.
Recently by using Visual Studio 2013 I have developed a program that displays alarm information based on its time and alarm tone settings. Those settings and files are stored in MySQL database.
The issue is:
Is there any way to install this application to another computer without requiring to export the database, install MySQL database and configuring it.
Just I want to Install the required database file and application at ones including to the Software installation package. or what you will advice me.
Using the Installshield Lite packaged with VS2013 you can create a setup that will include the setup of applications such as MySQL.
When the setup runs, it will install MySQL with the parameters provided. If you configure the application to use silent install as discussed here: https://dev.mysql.com/doc/refman/5.1/en/windows-installer-msi-quiet.html then the installation will be seen as 'part of' your setup.
For the settings, I would recommend creating a setup application (console app) that will read a .sql file etc and configure the database. This too can be run as a pre-requisite of your installation.
You can also do this all manually (i.e. write your own setup application that will call MySQL setup using Process class, install MySQL, create project folder, create shortcuts etc). The Installshield is not fully functional and a gets a lot of bad press, but will do the job for a quick/simple install.
I wanted to open my database up using sever explorer in visual studio 2012 and it told me I needed to upgrade my database from 3.5 to 4.0. Now when I deploy my application (WP8 project) it tells me Incompatible Database Version. If this was a compatible file, run repair. For other cases refer to documentation. [ Db version = 4000000,Requested version = 3505053,File name = mydatabase.sdf ]. How do I downgrade back to 3.5... I'm using VS2012 - surely if there was a quick upgrade like it did - there is a quick downgrade. :-)
I assume a backup wasn't created by the wizard. You could try using the SQL Server Compact Toolbox to downgrade from 4.0 to 3.5. There's a tutorial here on how to do it for SQL Server to 4/3.5 but it should be the same for CE 4 to 3.5. The idea is to export your database's information to a file that can then be used to create a 3.5 version of the database.
Before you try and downgrades, create a backup of the database just in case something else happens.
I am following the article Using SQLite Embedded Database with Entity Framework and Linq-to-SQL, and have tried installing the SQLite provider, first using the System.Data.SQLite NuGet package, and then by installing the provider via the Setups for 32-bit Windows (.NET /Framework 4.0) installer package (for v1.0.79). After both installs, and a system restart, I still see no SQLite Database File provider in the Add Connection dialogue from Server Explorer.
I can proceed by manually creating a connection string and using external tools to create my SQLite database file, but I still would like to know what is wrong why I do not have the advertised design time support for SQLite despite having installed the latest provider. What could be wrong here?
Ensure the data tools for visual studio were installed correctly as per:
http://www.basarat.com/2010/05/sqlite-for-visual-studio-2010.html
There are various fixes listed, making sure there weren't older tools installed first, etc.
I'm going to give it a try, but the article may help you out.
I've created an empty console application in Visual Studio 2010 and I'm attempting to add an Oracle (10g XE ) Data Connection via the Server Explorer. I'm using Oracle ODP .NET as the connector and I get the following error:
ORA-12560: TNS: Protocol Adapter Error
I can access Oracle without issue via the web interface or a console, but continually get this generic connection error in VS. I'm using the default installation of Oracle XE and running it locally.
Any suggestion on how to get this set up correctly ? Every tutorial I find works on the understanding that this connection succeeds. As such I'm struggling to find where to begin to troubleshoot. I'm comfortable with VS2010, but new to the way Oracle does things with their DB.
EDIT 1
While troubleshooting I've found this only happens with the Oracle Data Provider for .NET. Using the .NET Framework Data Provider for Oracle I am able to successfully connect.
EDIT 2
I cleaned up everything and installed 11g XE and the ODAC tools again and continue to get the same message. I realize the error is somewhat generic, I'd be happy to post more information if anyone thinks it helpful. The database is run locally, I can't imagine what kind of 'configuration' an express database would even need...
EDIT 3
The ODAC tools appear to install a 'production' version of Oracle 11 instead of the BETA version that I installed first. Almost appears as if the tool is installing another database ? I also appear to have two ORACLE_BASE locations and two TNSNAMES in what appear to be very similar folder hierarchies. Perhaps a more straightforward tutorial is the answer, Oracle's isn't very descriptive.
Oracle 10g XE seemed to be the problem. A full install of 11g (Full, not Express) took care of the problem entirely.
From here:
Possible fixes for the TNS-12560
include:
Get the latest patches for the SQL*Net client software.
Check your $ORACLE_HOME and $Path variables.
Check File permissions on the PC client.
Ensure that TNS_ADMIN is set correctly.
Check for firewall issues.
Check that the Windows database service is started. Verify teh
ORACLE_SID parameter is set correctly
in the registry.
Wow. I finally got this syntax to work.
I'm a Sql Server guy. I used Oracle back in the da day.
But I'm trying to do some Entity Framework and I said "You're not going to bed until you get Visual Studio 2012 and a edmx file to talk to Oracle.
Geeze.
Here is what I came up with:
Data Source:
Oracle Database (Oracle ODP.NET)
Data Source Name:
localhost:1521/orcl
User Name:
SYSTEM
change the default data source name to localhost.