Call a C# function from MySQL

258 Views Asked by At

Is it possible to call a C# function from MySQL ?

For instance, if a table changed, I'd like to call a C# function, instead of having C# constantly polling MySQL to check if a change occurred.

2

There are 2 best solutions below

0
On

No, you can't call a c# method from MySQL.

You'll need to re-architect your software with another approach.

0
On

It is possible

You can execute an external process from inside MySql, see for example: Execute shell commands from MySQL stored procedure

That process could then initiate a callback to the originating c# client, for example over a network socket.

But just because something is possible, does not mean it is a good idea!