Wednesday 15 January 2014

c# - Datatable to array and then to a Textbox -


I have only one column and a figure with only some integer rows I want them to transition to an array so that I can display them in a text box

You can use linux and string .Join :

  int [] nums = table.AsEnumerable (). Select (r = & gt; r.Field & lt; int & gt; (0)). ToArray (); TextBoxNums.Text = string.Join (",", nums);   

If you want to divide them by a new row:

  string [] nums = table.AsEnumerable (). Select (r = & gt; r .Field & LT; Integer & gt ;. (0) .ToString ()) toArray (); Text Boxes. Lines = nums;    

No comments:

Post a Comment