I want to apply culture to my data. I am retriving data from MYSQL database and checking datatype of each column. And according to datatype apply the culture. However I tried to do like
((ExcelRange)worksheet.Cells[6, dc.Ordinal + 1, table.Rows.Count + 6, dc.Ordinal + 1]).Style.Numberformat.Format = "mm/dd/yyyy";
But I want to apply these formats (date, currency, time) from CultureInfo. My CultureInfo is not fixed. It may change according to user.
public static CultureInfo customCulture = new CultureInfo("en-US");
foreach (DataColumn dc in table.Columns)
if (dc.DataType.Name == "DateTime")
((ExcelRange)worksheet.Cells[6, dc.Ordinal + 1, table.Rows.Count + 6, dc.Ordinal + 1]).Style.Numberformat.Format =
Apply Culture from customculture