You are talking about the Collection Initialiser feature added in C# 3. It is done like this:
DataTable table = new DataTable()
{
Columns =
{
new DataColumn("col1"),
new DataColumn("col2")
}
};
This does not call a collection constructor, it uses the collection which already exists in the DataTable.
This is short-hand for Columns.Add(), so it doesn't require Columns to have a setter.
You were so close with the code in your question!
You probably need to remove the paretheses around that collection initializer for DataColumnCollection, and remove the unmatched, final )
Those are syntactical issues, though. The underlying problems are that the Columns property has no setter, and the DataColumnCollection has no public constructor.
Basically, you have to instantiate and then call .Columns.Add().
If this is something you have to do a lot in your code, you could create helper classes that would give you friendlier syntax:
DataTable table = DataTableFactory.CreateTableWithColumns("col1", "col2");
You can't use that syntax as the Columns property is readonly. I'd use the technique suggested by Gabe.