Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27329

[RESOLVED] One-line datatable row creation

$
0
0
I can add a new row to the end of a datatable in one line:

Code:

MyTable.Rows.Add(FirstValue, SecondValue, etc)
But if I want to just create a new row, all the examples I've seen add each field one at a time:

Code:

Dim newrow As DataRow = MyTable.NewRow
newrow.Item("First Column") = FirstValue
newrow.Item("Second Column") = SecondValue

Is there a one-line way to make a new row?

Viewing all articles
Browse latest Browse all 27329

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>