.net - Setting the size of char datacolumn -


i add new column datatable. column of type char length of 10.

datacolumn d = new datacolumn(fieldname, typeof(char)); dt.columns.add(d);

my question how add "size" column?

thanks lot.

note in c#, char always 1 character. try this:

datacolumn d = new datacolumn(fieldname, typeof(string)); d.maxlength = 10; dt.columns.add(d); 

Comments

Popular posts from this blog

Python __call__ special method practical example -

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -