I have code:
MyDataAdapter.SelectCommand = MySelectCommand;
MyDataAdapter.Fill(MyDataTable);
MyDataGrid.ItemsSource = MyDataTable.DefaultView;
MyDataGrid.Columns.Add(MyDataGridTextColumn1);
MyDataGrid.Columns.Add(MyDataGridTextColumn2);
MyDataGrid.Columns.Add(MyDataGridTextColumn3);
...
MyDataGrid.Columns.Add(MyDataGridTextColumnXXX);
At next step I want to format added columns according to theirs database data type. But there is time limit for building of MyDataGrid. How to do it by the best and fast way?
MyDataTable.Columns[i].DataType.Name;
or
NpgsqlDataReader dr = MyDataAdapter.SelectCommand.ExecuteReader();
dr.GetDataTypeName(i);
where i - index of interesting column