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

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -