Excelデータベースレコードを更新する IronXLの ToDataSet メソッドを使用すると、開発者は最小限の労力で Excel データから直接 SQL データベース レコードを同期および更新できます。 この機能は、Excel ブックを DataSet に変換することで、表形式の Excel データとリレーショナル データベース間のシームレスな統合を実現します。 これにより、手動でのデータ入力や複雑な変換の必要がなくなり、データ管理ワークフローが大幅に効率化されます。 この機能は、外部のExcelファイルからデータベースレコードに定期的な更新が必要なアプリケーション、たとえば顧客データ、財務記録、または在庫管理システムに特に有用です。 SQLクエリおよびアダプタとの互換性により、開発者はExcelデータを既存のデータベーススキーマにマッピングできます。 IronXLは複数のExcelフォーマット(XLSX、CSVなど)をサポートし、さまざまなユースケースに対する多様性を確保します。 この機能は、一括更新に SqlDataAdapter を活用することで、データ処理時間を短縮し、エラーを最小限に抑え、Excel とデータベース レコード間の一貫性を確保するため、エンタープライズ グレードのアプリケーションに最適なソリューションとなります。 ## Excel のデータを使用して SQL データベースを更新する 5 つの手順 `var workBook = WorkBook.Load("Products.xlsx");`。 `DataSet dataSet = workBook.ToDataSet();`. `string sql = "SELECT * FROM products";`. `using var adapter = new SqlDataAdapter(sql, new SqlConnection("Your Connection String"));`. `new SqlCommandBuilder(adapter).DataAdapter.Update(dataSet);`。 このコードは、IronXLとADO.NETを使用してExcelファイルからSQLデータベースを更新するプロセスを示しています。 The WorkBook.Load method loads the Excel file named Products.xlsx into memory, and the ToDataSet method converts the workbook into a DataSet, which organizes the data into a tabular structure compatible with ADO.NET. A SQL query is defined to interact with a specific table in the database (products). The SqlDataAdapter is initialized with the query and a connection string, enabling it to act as a bridge between the DataSet and the database. The SqlCommandBuilder is used to automatically generate the necessary SQL commands for inserting, updating, or deleting data in the database. Finally, the adapter.Update(dataSet) method synchronizes the changes in the DataSet (populated from the Excel file) with the corresponding database table. これにより、データ転送プロセスが効率化され、データベースがExcelファイルの最新の変更を反映することが保証されます。 IronXLでデータセットをExcelにエクスポートする方法を学ぶ 関連ドキュメントリンク Githubで見る 関連チュートリアル 関連ハウツーガイド クラスドキュメンテーション IronXL DLLをダウンロード このページの問題を報告する A PHP Error was encountered Severity: Notice Message: Undefined index: IronXl.Excel Filename: helpers/counter_helper.php Line Number: 85 Backtrace: File: /var/www/ironpdf.com/application/helpers/counter_helper.php Line: 85 Function: _error_handler File: /var/www/ironpdf.com/application/views/main/sections/ready_to_started_202509.php Line: 12 Function: getTotalDonwloadNumber File: /var/www/ironpdf.com/application/libraries/Render.php Line: 489 Function: view File: /var/www/ironpdf.com/application/controllers/Products/Examples.php Line: 44 Function: render_products_view File: /var/www/ironpdf.com/index.php Line: 292 Function: require_once A PHP Error was encountered Severity: Notice Message: Undefined index: IronXl.Excel Filename: helpers/counter_helper.php Line Number: 85 Backtrace: File: /var/www/ironpdf.com/application/helpers/counter_helper.php Line: 85 Function: _error_handler File: /var/www/ironpdf.com/application/views/main/sections/ready_to_started_202509.php Line: 19 Function: getTotalDonwloadNumber File: /var/www/ironpdf.com/application/libraries/Render.php Line: 489 Function: view File: /var/www/ironpdf.com/application/controllers/Products/Examples.php Line: 44 Function: render_products_view File: /var/www/ironpdf.com/index.php Line: 292 Function: require_once 準備はできましたか? Nuget ダウンロード 1,890,100 | バージョン: 2026.3 リリース 無料トライアル NuGet 無料版 総ダウンロード数: 1,890,100 ライセンスを見る A PHP Error was encountered Severity: Notice Message: Undefined index: IronXl.Excel Filename: helpers/counter_helper.php Line Number: 85 Backtrace: File: /var/www/ironpdf.com/application/helpers/counter_helper.php Line: 85 Function: _error_handler File: /var/www/ironpdf.com/application/views/main/sections/still_scrolling_202512.php Line: 17 Function: getTotalDonwloadNumber File: /var/www/ironpdf.com/application/views/products/examples/index.php Line: 270 Function: view File: /var/www/ironpdf.com/application/libraries/Render.php Line: 88 Function: view File: /var/www/ironpdf.com/application/libraries/Render.php Line: 552 Function: view File: /var/www/ironpdf.com/application/controllers/Products/Examples.php Line: 44 Function: render_products_view File: /var/www/ironpdf.com/index.php Line: 292 Function: require_once A PHP Error was encountered Severity: Notice Message: Undefined index: IronXl.Excel Filename: helpers/counter_helper.php Line Number: 85 Backtrace: File: /var/www/ironpdf.com/application/helpers/counter_helper.php Line: 85 Function: _error_handler File: /var/www/ironpdf.com/application/views/main/sections/still_scrolling_202512.php Line: 24 Function: getTotalDonwloadNumber File: /var/www/ironpdf.com/application/views/products/examples/index.php Line: 270 Function: view File: /var/www/ironpdf.com/application/libraries/Render.php Line: 88 Function: view File: /var/www/ironpdf.com/application/libraries/Render.php Line: 552 Function: view File: /var/www/ironpdf.com/application/controllers/Products/Examples.php Line: 44 Function: render_products_view File: /var/www/ironpdf.com/index.php Line: 292 Function: require_once まだスクロールしていますか? すぐに証拠が欲しいですか? PM > Install-Package IronXl.Excel サンプルを実行する あなたのデータがスプレッドシートになるのを見る。 NuGet 無料版 総ダウンロード数: 1,890,100 ライセンスを見る