Delete rows from mysql server from a list of ID's C#

ado.net, c#, mysql

Solution

You would probably use an `IN` clause in your `DELETE`:

DELETE FROM `EmployeeTable` WHERE EmployeeID IN (2, 3, 4, 5, ...)

This could be implemented with the `String.Join` method to generate the list:

var query = "DELETE FROM `EmployeeTable` WHERE EmployeeID IN (" +
    String.Join(",", myArray) + ")";

Problem

I'm trying to delete a series of rows in a MySQL table from a list of ID's in C#. There's an employeeID row in the table. Basically my question is what kind of syntax would I use?

Original source