全て
| カテゴリ未分類
| 通常
| 数学
| 投資
| 副業
| 転職・就職
| ブログ
| 株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
using System; using System.Data; using System.Linq; class Program { static void Main() { // サンプルのDataTableを作成 DataTable table = new DataTable(); table.Columns.Add("Column1", typeof(int)); table.Columns.Add("Column2", typeof(string)); table.Columns.Add("Column3", typeof(double)); // サンプルのデータを追加 table.Rows.Add(1, "Value1", 10.5); table.Rows.Add(2, "Value2", 20.3); table.Rows.Add(3, "Value3", 30.7); // LINQを使用して列1、列2、列3のデータを抽出 var result = from DataRow row in table.Rows select new { Column1 = row["Column1"], Column2 = row["Column2"], Column3 = row["Column3"] }; // 結果を出力 foreach (var item in result) { Console.WriteLine($"Column1: {item.Column1}, Column2: {item.Column2}, Column3: {item.Column3}"); } } } お気に入りの記事を「いいね!」で応援しよう
Last updated
2024.02.26 01:56:04
[LINQ] カテゴリの最新記事
|