Need to get empty datatable in .net with database table schema

.net, ado.net, c#, datatable, sql-server

Solution

A statement I think is worth mentioning is SET FMTONLY:

SET FMTONLY ON;
SELECT * FROM SomeTable
SET FMTONLY OFF;

No rows are processed or sent to the client because of the request when SET FMTONLY is turned ON.

The reason this can be handy is because you can supply any query/stored procedure and return just the metadata of the resultset.

Problem

What is the best way to create an Empty DataTable object with the schema of a sql server table?

Original source