c# - How to change datatable column name -
hi change data table column name upper case (first latter) tried below code
e.g
i need convert below
name name
code
foreach (datacolumn column in obj_dt.columns) column.columnname = column.columnname.toupper();
but converting full name upper case need convert first latter ... how can it... thanks...
in cultureinfo.textinfo class have many methods deal culture specific casing rules. method looking is: totitlecase
textinfo ti = cultureinfo.currentculture.textinfo; foreach (datacolumn column in obj_dt.columns) column.columnname = ti.totitlecase(column.columnname);
you need add using system.globalization;
Comments
Post a Comment