Getting size of a column from a datatable?

Posted by Peermohamedmydeen under C# on 4/5/2011 | Points: 10 | Views : 9306 | Status : [Member] | Replies : 2
I want to get the defined size of a column from a datatable. How can I do this?

dt.Colums[0].Maxlength always return -1. why?




Responses

Posted by: WilPeters on: 4/10/2011 [Member] Starter | Points: 25

Up
0
Down
you have to set the maxlength field before a column has a max length, else the value will be -1

http://msdn.microsoft.com/en-us/library/system.data.datacolumn.maxlength.aspx

Peermohamedmydeen, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gsolvers on: 4/10/2011 [Member] Starter | Points: 25

Up
0
Down
Great one!

Best Regards,

VG
www.TeacherJi.com

Peermohamedmydeen, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response