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# kill one excel process 
Csharp :: c# select a row from datagridview by value 
Csharp :: c# today without time 
Csharp :: c# signalr console app client example 
Csharp :: how to remove all whitespace from a string in c# 
Csharp :: wpf get function name 
Csharp :: c# convert list to array function 
Csharp :: c# combobox add item 
Csharp :: test how catch exception c# 
Csharp :: c# close form 
Csharp :: c# display image 
Csharp :: c# get gridview DataKeyNames 
Csharp :: cast char[] to string c# 
Csharp :: static c# 
Csharp :: c# set cursor to loading and back 
Csharp :: how to get the size an array in unity 
Csharp :: type or namespace text could not be found unity 
Csharp :: c# debug writeline 
Csharp :: entity framework core genetare class using existing database 
Csharp :: entity framework delete record with foreign key constraint 
Csharp :: defualtsize UWP c# 
Csharp :: c# parse number from string 
Csharp :: visual studio c# mark class deprecated 
Csharp :: shut game unity 
Csharp :: unity 2d enemy patrol script 
Csharp :: c# string 
Csharp :: c# tuple 
Csharp :: unity rb.addexplosionforce 2d 
Csharp :: c# setting window size 
Csharp :: c# compare dateTime with string 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =