How to convert a DataRow array to a DataTable without iteration?
You can use:
dataTable = datarowarray.CopyToDataTable()
but be sure to have datarowarrayit length > 1, otherwise it will end with unwanted exceptions.
datarowarray
length > 1
I don't think you can put an array of datarows in a datatable. You can import one row at a time using DataTable.ImportRow.
foreach(DataRow row in dataRowArray) { dataTable.ImportRow(row); }
.NET framework,
myDataTable.LoadRows(dataRowArray)
... , , hide . ( - gee-whiz smart, ).
DataTable dt = new DataTable(); DataRow[] dataRowArray = dt.Select(""); DataTable dataTable = new DataTable(); foreach (DataRow row in dataRowArray) { dataTable = dataTable.Clone(); dataTable.ImportRow(row); }
Source: https://habr.com/ru/post/1739252/More articles:Как правильно unit test сеанс Django? - pythonКак получить текст, который был нажат в Javascript? - javascriptHow to convert (rotate) an existing CALayer / animation? - iphoneRails ActionMailer Plugin for TLS Encryption - ruby-on-railshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1739251/are-there-any-libraries-to-allow-python-or-ruby-to-get-info-from-svn&usg=ALkJrhipKIdIDRi401QsI2R3WqDtdXA5Egto read a file with text and binary information in .Net - c #Check excel file opened by another user - vb.netWhat happens to a server request if a client suddenly closes its connection - asp.netHow to open a file and directory in QT - qtPython: List of modules (>>> help ('modules') does not work) - pythonAll Articles