How to use select statement in a delete statement using MSSQL

To use select statement in a delete statement using MSSQL you can use the snippet below.

Sample MSSQL

DELETE TableOne
FROM   TableOne
       INNER JOIN TableTwo
               ON TableTwo.Id= TableOne.Id
                  AND ...
                       WHERE ...

Please rate this snippet

How to remove columns from DataTable in C# and VB.NET

To remove columns from DataTable in C# and VB.NET you can use the snippet below.

Sample C#

DataTable dataTable;
dataTable.Columns.Remove("Columnname");
dataTable.Columns.RemoveAt(index);

Sample VB.NET

Dim dataTable As DataTable
dataTable.Columns.Remove("Columnname")
dataTable.Columns.RemoveAt(index)

Please rate this snippet