Hi
@devneetmohanty07I just found a code in C# on this
Threadwhich helps in Inserting a New Column before last column of collection. When I tried this code, the result am getting as Empty Output Collection.
As I can see by your previous threads, that you are an expert in VB.Net and collections , Could you modify this code to VB.net and make it to work as dynamic where I can Insert a Column at any required position.
DataTable Newdt = new DataTable("OutputDataTable");
for (int i=0; i<+ InputCollection.Columns.Count - 2; i++)
{
DataColumn col = new DataColumn(InputCollection.Columns
.ToString(), typeof(System.String));
Newdt.Columns.Add(col);
}
DataColumn Newcol = new DataColumn(ColumnToAdd, typeof(System.String));
Newdt.Columns.Add(Newcol);
Newdt.Columns.Add(InputCollection.Columns[InputCollection.Columns.Count-1].ToString(), typeof(System.String));
OutputCollection=Newdt;
Thanks in advance.
------------------------------
vinod chinthakindi
------------------------------