Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

datatable to array c#

string[] arrray = dt.Rows.OfType<DataRow>().Select(k => k[0].ToString()).ToArray();
Comment

array object to datatable c#

public static DataTable ArraytoDatatable(Object[,] numbers)
{                 
    DataTable dt = new DataTable();
    for (int i = 0; i < numbers.GetLength(1); i++)
    {
        dt.Columns.Add("Column" + (i + 1));
    }

    for (var i = 0; i < numbers.GetLength(0); ++i)
    {
        DataRow row = dt.NewRow();
        for (var j = 0; j < numbers.GetLength(1); ++j)
        {
            row[j] = numbers[i, j];
        }
        dt.Rows.Add(row);
    }
    return dt;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# add object to array 
Csharp :: float and int need help 
Csharp :: Unity Interstitial ad C# 
Csharp :: how to run a c# program 
Csharp :: c# return task list 
Csharp :: single line and multiline comments in c 
Csharp :: instantiate a player in photon 
Csharp :: How does works Unity interfaces 
Csharp :: asp.net core mvc jsonresult example 
Csharp :: c# dictionary keys to list 
Csharp :: c# radio button checked 
Csharp :: google script get time 
Csharp :: unity gui text 
Csharp :: how to restart flutter app programmatically 
Csharp :: c# replace dash in string 
Csharp :: transform.position.x unity 
Csharp :: how to check if List<T element contains an item with a Particular Property Value in c# 
Csharp :: Dyanmically create datatable in c# 
Csharp :: c# check if char is string 
Csharp :: change scale of an object unity 
Csharp :: how to define a function in c# 
Csharp :: blazor ref to component in if 
Csharp :: c# wpf get clipboard text 
Csharp :: unity yield return 
Csharp :: string to chararray c# 
Csharp :: wpf textblock line break code behind 
Csharp :: how to pass id from view to controller in asp.net core 
Csharp :: Search for a value into a list in c# 
Csharp :: c# parse number from string 
Csharp :: unity get prefabs from folder 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =