How to connect to Mysql from C# as MT4 dll? - c#

I am new to C#. I want to connect to Mysql Database from MT4 using DLL. I found how to create MT4 dll using C# here : http://vb6-to-csharp.blogspot.com/2012/04/code-to-export-c-dll-to-metatrader.html , and how to connect to Mysql database using C# here: http://www.codeproject.com/Tips/423233/How-to-Connect-to-MySQL-Using-Csharp .
How to combine both to connect to Mysql from MT4 ?
Thanks

MT4 is C++ not C#. In fact by using C# you are complicating things unnecessarily because you need to marshall the datatypes between the two languages. Also you didn't specify what part of mt4 you want to connect. I assume it's the client terminal via an expert advisor's dll. The simplest way is to write a dll using C++ which will export the methods you need for writing to the database.

If you prefer C# over MQL a viable option is to use a framework that lets you code a complete EA using C#. For example this bridge: NQuotes : C# API for MetaTrader let's you doing that. Then you can use your MySQL tutorial as it is.

Related

Using C outb function in C# with System.IO

I have an old software development source code to transfer data from PC to and specific hardware.
This code use the method outb(value,port) to write value in the specific port. I can't use the binary files in modern operative system so, I thought make a new version with C#, porting this C code to C# code.
I'm not familiar with System.IO.Ports namespace. Someone knows how I can use a method similar to outb() in C#?¿
Thanks

How can I used Oracle cloud infrastructure JAVA SDK in .Net application with C# to access storage

As per my knowledge oracle oracle cloud infrastructure API can be used in .Net application to access database.But I don't know if it is possible with JAVA SDK
This question appears to more generally be 'can I call Java functionality from C#?' I suspect the answer is yes, but I don't have the details on that. Please take a look at these posts related to that:
How to call Java code from C#?
https://github.com/jni4net/jni4net/wiki/Calling-Java-in-C%23
https://www.c-sharpcorner.com/UploadFile/ajyadav123/invoking-java-code-in-C-Sharp-net/
However, I wanted to make sure you know about the C# signing sample that we have available in the OCI documentation, which calls out how to make HTTP requests to OCI services using C# code. This would allow you to not have to use the Java SDK at all from your C# application, and instead use only C# code to talk to OCI.

Connect to .net DataServices using Monotouch?

Is there any way to connect to Data Services using monotouch? creating a DataServices client an example would be really helpful
Yes, it is avaible on monotouch it's under:
/Developer/MonoTouch/usr/lib/mono/2.1
I really don't know why it's not included on the stack, but you can reference it and it will work. Once imported into the project just use:
using System.Data.Services.Client;
I don't have an example, but it should work. :)

Can you use a C# library in a AMP-server?

Is it possible for me to build some database functionality in a C#-library (using LINQ 2 SQL) and then somehow import it into a php (joomla) project?
One way to do it is to register the .NET assembly as COM object (using regasm.exe) and then consume it from PHP.

SQLite3 in C#.NET

I'm trying to use SQLite3 in C#.NET. I've googled around and found some different API's. I also checked SQLite's website for wrappers. I like them, but want to write my own wrapper without using an added dependency. All wrappers I find that don't require an added dependency aren't free.
I'm wondering how one would read from, execute, and write to a sqlite3 database. Is it a socket connection(tcp? udp? etc?)? I've tried searching this answer on google and all I get are library-specific answers. :/ SQLite's website docs aren't much help either.
EDIT: I also found a COM interface while googling, but is that library specific?
Thanks SO! :)
Have you looked at the System.Data.SQLite library? It's a free ADO.NET library to interact with SQLite and requires nothing else in order to run, since it has the engine built into it.
I've been using it for a while now and find it really easy to work with. It even has a plugin for Visual Studio should you decide to use some strongly-typed tables with it or want to use it to add/create tables.
(Answering the "socket connection" question.)
Part of the point of SQLite is that it's an embedded database - there's no server to talk to, you load the library directly into your process and it talks to the file system directly.
If you want to use SQLite in .NET, you should take a look at System.Data.SQLite, which is a ADO.NET provider for SQLite
System.Data.SQLite is comparatively slower than other providers like SqlClient. I have look into its code.
Now I want to call it throw P/Invoke but not like SQLite provider. It call through P/Invoke every time when ever you access column value through DataReader

Categories

Resources