全て
| カテゴリ未分類
| 通常
| 数学
| 投資
| 副業
| 転職・就職
| ブログ
| 株Stock
| VBA
| SharePoint
| REST API
| RenderListDataAsStream
| PowerAutomateDesktop
| Graph API
| PowerApps
| PowerAutomate
| PowerFx
| OfficeScriptオフィススクリプト
| PowerAutomate日時Excel日時相互関係
| PowerShell
| Dataverse
| UiPath
| OneDrive
| LINQ
| VB.NET
| C#.NET
| WPFC#.NET
| Git
カテゴリ:LINQ
Imports System Imports System.Data Imports System.Linq Module Program Sub Main() ' サンプルのDataTableを作成する Dim table As New DataTable() table.Columns.Add("列1", GetType(Integer)) table.Columns.Add("列2", GetType(String)) table.Columns.Add("列3", GetType(Double)) ' ダミーデータを追加する table.Rows.Add(1, "A", 10.5) table.Rows.Add(2, "B", 20.7) table.Rows.Add(3, "C", 30.9) ' LINQを使用して列1、列2、列3のデータを取得する Dim queryResult = From row As DataRow In table.Rows Select New With { .列1 = DirectCast(row("列1"), Integer), .列2 = DirectCast(row("列2"), String), .列3 = DirectCast(row("列3"), Double) } ' 結果を出力する For Each item In queryResult Console.WriteLine($"列1: {item.列1}, 列2: {item.列2}, 列3: {item.列3}") Next End Sub End Module お気に入りの記事を「いいね!」で応援しよう
Last updated
2024.02.24 07:08:32
[LINQ] カテゴリの最新記事
|