{"id":1406,"date":"2025-10-10T15:09:37","date_gmt":"2025-10-10T08:09:37","guid":{"rendered":"https:\/\/portal-atlasx.cdg.co.th\/home\/?post_type=docs&#038;p=1406"},"modified":"2025-11-12T15:11:32","modified_gmt":"2025-11-12T08:11:32","slug":"database-bulk-copy","status":"publish","type":"docs","link":"https:\/\/portal-atlasx.cdg.co.th\/home\/docs\/axws7\/techniques\/database-bulk-copy\/","title":{"rendered":"Database Bulk Copy"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\" id=\"database-bulk-copy\">Database Bulk Copy<\/h1>\n\n\n\n<p>SQL Bulk Copy \u0e40\u0e1b\u0e47\u0e19\u0e2a\u0e48\u0e27\u0e19\u0e17\u0e35\u0e48\u0e0a\u0e48\u0e27\u0e22\u0e43\u0e19\u0e01\u0e32\u0e23 Insert \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e02\u0e19\u0e32\u0e14\u0e43\u0e2b\u0e0d\u0e48\u0e25\u0e07\u0e15\u0e32\u0e23\u0e32\u0e07\u0e44\u0e14\u0e49\u0e23\u0e27\u0e14\u0e40\u0e23\u0e47\u0e27\u0e21\u0e32\u0e01\u0e02\u0e36\u0e49\u0e19 \u0e16\u0e49\u0e32\u0e40\u0e1b\u0e47\u0e19\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e01\u0e48\u0e2d\u0e19\u0e43\u0e19\u0e01\u0e32\u0e23\u0e08\u0e30 Insert \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e02\u0e19\u0e32\u0e14\u0e43\u0e2b\u0e0d\u0e48\u0e25\u0e07\u0e15\u0e32\u0e23\u0e32\u0e07\u0e41\u0e15\u0e48\u0e25\u0e30\u0e04\u0e23\u0e31\u0e49\u0e07\u0e19\u0e31\u0e49\u0e19\u0e40\u0e23\u0e32\u0e08\u0e30\u0e40\u0e02\u0e35\u0e22\u0e19 Code \u0e43\u0e2b\u0e49\u0e17\u0e33\u0e01\u0e32\u0e23\u0e2d\u0e48\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e41\u0e25\u0e49\u0e27\u0e04\u0e48\u0e2d\u0e22 Insert \u0e17\u0e35\u0e25\u0e30\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e40\u0e2d\u0e07\u0e08\u0e19\u0e01\u0e27\u0e48\u0e32\u0e08\u0e30\u0e04\u0e23\u0e1a\u0e17\u0e38\u0e01\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23 \u0e41\u0e15\u0e48\u0e01\u0e32\u0e23 Insert \u0e17\u0e35\u0e25\u0e30\u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\u0e40\u0e2d\u0e07\u0e14\u0e49\u0e27\u0e22\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e02\u0e19\u0e32\u0e14\u0e43\u0e2b\u0e0d\u0e48\u0e19\u0e31\u0e49\u0e19\u0e01\u0e47\u0e2a\u0e48\u0e07\u0e1c\u0e25\u0e04\u0e27\u0e32\u0e21\u0e25\u0e48\u0e32\u0e0a\u0e49\u0e32\u0e43\u0e19\u0e01\u0e32\u0e23 Insert \u0e40\u0e0a\u0e48\u0e19\u0e01\u0e31\u0e19 \u0e17\u0e32\u0e07 AtlasX \u0e08\u0e36\u0e07\u0e21\u0e35\u0e15\u0e31\u0e27\u0e0a\u0e48\u0e27\u0e22\u0e43\u0e19\u0e01\u0e32\u0e23 Insert \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e02\u0e19\u0e32\u0e14\u0e43\u0e2b\u0e0d\u0e48\u0e19\u0e35\u0e49\u0e17\u0e35\u0e48\u0e0a\u0e37\u0e48\u0e2d\u0e27\u0e48\u0e32 BulkCopy \u0e21\u0e32\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<h5 class=\"wp-block-heading\">Note<\/h5>\n\n\n\n<p><strong>AtlasX Version Support<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>AtlasX Web Service<\/code>\u00a0v1.1.1 \u0e40\u0e1b\u0e47\u0e19\u0e15\u0e49\u0e19\u0e44\u0e1b<\/li>\n\n\n\n<li><code>AtlasX Engine<\/code>\u00a0v1.2.0 \u0e40\u0e1b\u0e47\u0e19\u0e15\u0e49\u0e19\u0e44\u0e1b<\/li>\n<\/ul>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\">\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u0e17\u0e33\u0e01\u0e32\u0e23 Inject\u00a0<code>IDbDataAccessService<\/code>\u00a0\u0e40\u0e02\u0e49\u0e32\u0e21\u0e32\u0e43\u0e19\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19\u00a0<code>Constuctor<\/code><\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>using AtlasX.Engine.Connector.Services; &lt;em>\/\/ &lt;-- namespace \u0e02\u0e2d\u0e07 IDbDataAccessService&lt;\/em>\nusing AtlasX.Engine.Extensions; &lt;em>\/\/ &lt;-- \u0e19\u0e33\u0e21\u0e32\u0e43\u0e0a\u0e49\u0e41\u0e1b\u0e25\u0e07 List \u0e40\u0e1b\u0e47\u0e19 DataTable&lt;\/em>\nusing CsvHelper; &lt;em>\/\/ &lt;-- \u0e19\u0e33\u0e21\u0e32\u0e0a\u0e48\u0e27\u0e22\u0e2d\u0e48\u0e32\u0e19\u0e44\u0e1f\u0e25\u0e4c CSV, \u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e0a\u0e31\u0e19 15.0.5&lt;\/em>\n...\n\nnamespace MyWebService.Controllers\n{\n  [Route(\"api\/&#91;controller&#93;\")]\n  &#91;ApiController&#93;\n  public class MyBulkCopyController : ControllerBase\n  {\n    private readonly IDbDataAccessService _dbDataAccessService;\n    private readonly IWebHostEnvironment _hostingEnvironment;\n\n    public MyBulkCopyController(\n      IDbDataAccessService dbDataAccessService, &lt;em>\/\/ &lt;-- Inject DbDataAccessService&lt;\/em>\n      IWebHostEnvironment hostingEnvironment\n    )\n    {\n      _dbDataAccessService = dbDataAccessService;\n      _hostingEnvironment = hostingEnvironment;\n    }\n  }\n\n  ...\n\n}<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #0000FF\">using<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0070C1\">AtlasX<\/span><span style=\"color: #000000\">.Engine.Connector.Services; &lt;<\/span><span style=\"color: #001080\">em<\/span><span style=\"color: #000000\">&gt;<\/span><span style=\"color: #008000\">\/\/ &lt;-- namespace \u0e02\u0e2d\u0e07 IDbDataAccessService&lt;\/em&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">using<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0070C1\">AtlasX<\/span><span style=\"color: #000000\">.Engine.Extensions; &lt;<\/span><span style=\"color: #001080\">em<\/span><span style=\"color: #000000\">&gt;<\/span><span style=\"color: #008000\">\/\/ &lt;-- \u0e19\u0e33\u0e21\u0e32\u0e43\u0e0a\u0e49\u0e41\u0e1b\u0e25\u0e07 List \u0e40\u0e1b\u0e47\u0e19 DataTable&lt;\/em&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">using<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0070C1\">CsvHelper<\/span><span style=\"color: #000000\">; &lt;<\/span><span style=\"color: #001080\">em<\/span><span style=\"color: #000000\">&gt;<\/span><span style=\"color: #008000\">\/\/ &lt;-- \u0e19\u0e33\u0e21\u0e32\u0e0a\u0e48\u0e27\u0e22\u0e2d\u0e48\u0e32\u0e19\u0e44\u0e1f\u0e25\u0e4c CSV, \u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e0a\u0e31\u0e19 15.0.5&lt;\/em&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">...<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #0000FF\">namespace<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">MyWebService<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #267F99\">Controllers<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  [<\/span><span style=\"color: #795E26\">Route<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #A31515\">&quot;api\/&#91;controller&#93;&quot;<\/span><span style=\"color: #000000\">)]<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  &#91;<\/span><span style=\"color: #001080\">ApiController<\/span><span style=\"color: #000000\">&#93;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #001080\">public<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0000FF\">class<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #267F99\">MyBulkCopyController<\/span><span style=\"color: #000000\"> : <\/span><span style=\"color: #267F99\">ControllerBase<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #0000FF\">private<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0000FF\">readonly<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">IDbDataAccessService<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">_dbDataAccessService<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #0000FF\">private<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #0000FF\">readonly<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">IWebHostEnvironment<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">_hostingEnvironment<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    <\/span><span style=\"color: #0000FF\">public<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">MyBulkCopyController<\/span><span style=\"color: #000000\">(<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #001080\">IDbDataAccessService<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">dbDataAccessService<\/span><span style=\"color: #000000\">, &lt;<\/span><span style=\"color: #001080\">em<\/span><span style=\"color: #000000\">&gt;<\/span><span style=\"color: #008000\">\/\/ &lt;-- Inject DbDataAccessService&lt;\/em&gt;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #001080\">IWebHostEnvironment<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">hostingEnvironment<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    )<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #001080\">_dbDataAccessService<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #001080\">dbDataAccessService<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">      <\/span><span style=\"color: #001080\">_hostingEnvironment<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #001080\">hostingEnvironment<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">    }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  }<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  ...<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li>\u0e2d\u0e48\u0e32\u0e19\u0e44\u0e1f\u0e25\u0e4c CSV \u0e41\u0e25\u0e49\u0e27\u0e41\u0e1b\u0e25\u0e07\u0e40\u0e1b\u0e47\u0e19 DataTable (\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49\u0e27\u0e34\u0e18\u0e35\u0e2d\u0e37\u0e48\u0e19\u0e44\u0e14\u0e49)<\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>\/\/ \u0e2a\u0e23\u0e49\u0e32\u0e07\u0e1e\u0e32\u0e17\u0e02\u0e2d\u0e07\u0e44\u0e1f\u0e25\u0e4c CSV \u0e17\u0e35\u0e48\u0e21\u0e35\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 100,000 \u0e23\u0e32\u0e22\u0e01\u0e32\u0e23\nstring filePath = _hostingEnvironment.ContentRootPath;\nfilePath = Path.Join(filePath, \"Data\", \"yellow_tripdata_2019-12_100000.csv\");\n\nList&lt;YellowTripData> csvData;\nDataTable dataTable = null;\n\n\nusing (var reader = new StreamReader(filePath, Encoding.UTF8))\nusing (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))\n{\n  \/\/ \u0e2d\u0e48\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e43\u0e19\u0e44\u0e1f\u0e25\u0e4c CSV \u0e41\u0e25\u0e49\u0e27\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e40\u0e1b\u0e47\u0e19 List\n  csvData = csv.GetRecords&lt;YellowTripData>().ToList();\n  \/\/ \u0e41\u0e1b\u0e25\u0e07 List \u0e40\u0e1b\u0e47\u0e19 DataTable\n  dataTable = csvData.ToDataTable&lt;YellowTripData>();\n}<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #008000\">\/\/ \u0e2a\u0e23\u0e49\u0e32\u0e07\u0e1e\u0e32\u0e17\u0e02\u0e2d\u0e07\u0e44\u0e1f\u0e25\u0e4c CSV \u0e17\u0e35\u0e48\u0e21\u0e35\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 100,000 \u0e23\u0e32\u0e22\u0e01\u0e32\u0e23<\/span><\/span>\n<span class=\"line\"><span style=\"color: #001080\">string<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">filePath<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #001080\">_hostingEnvironment<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #001080\">ContentRootPath<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #001080\">filePath<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #001080\">Path<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">Join<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">filePath<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #A31515\">&quot;Data&quot;<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #A31515\">&quot;yellow_tripdata_2019-12_100000.csv&quot;<\/span><span style=\"color: #000000\">);<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #001080\">List<\/span><span style=\"color: #000000\">&lt;<\/span><span style=\"color: #001080\">YellowTripData<\/span><span style=\"color: #000000\">&gt; <\/span><span style=\"color: #001080\">csvData<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #001080\">DataTable<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">dataTable<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #0000FF\">null<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #795E26\">using<\/span><span style=\"color: #000000\"> (<\/span><span style=\"color: #001080\">var<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">reader<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #0000FF\">new<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">StreamReader<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">filePath<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #001080\">Encoding<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #0070C1\">UTF8<\/span><span style=\"color: #000000\">))<\/span><\/span>\n<span class=\"line\"><span style=\"color: #795E26\">using<\/span><span style=\"color: #000000\"> (<\/span><span style=\"color: #001080\">var<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">csv<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #0000FF\">new<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">CsvReader<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">reader<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #001080\">CultureInfo<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #001080\">InvariantCulture<\/span><span style=\"color: #000000\">))<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">{<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #008000\">\/\/ \u0e2d\u0e48\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e43\u0e19\u0e44\u0e1f\u0e25\u0e4c CSV \u0e41\u0e25\u0e49\u0e27\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e40\u0e1b\u0e47\u0e19 List<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #001080\">csvData<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #001080\">csv<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">GetRecords<\/span><span style=\"color: #000000\">&lt;<\/span><span style=\"color: #267F99\">YellowTripData<\/span><span style=\"color: #000000\">&gt;().<\/span><span style=\"color: #795E26\">ToList<\/span><span style=\"color: #000000\">();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #008000\">\/\/ \u0e41\u0e1b\u0e25\u0e07 List \u0e40\u0e1b\u0e47\u0e19 DataTable<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">  <\/span><span style=\"color: #001080\">dataTable<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #001080\">csvData<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">ToDataTable<\/span><span style=\"color: #000000\">&lt;<\/span><span style=\"color: #267F99\">YellowTripData<\/span><span style=\"color: #000000\">&gt;();<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>\u0e40\u0e23\u0e35\u0e22\u0e01\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19\u00a0<code>BulkCopy()<\/code><\/li>\n<\/ol>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>string destinationTableName = \"TEST_BULK_COPY\";\n_dbDataAccessService.BulkCopy(destinationTableName, dataTable);<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #001080\">string<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">destinationTableName<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #A31515\">&quot;TEST_BULK_COPY&quot;<\/span><span style=\"color: #000000\">;<\/span><\/span>\n<span class=\"line\"><span style=\"color: #001080\">_dbDataAccessService<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">BulkCopy<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">destinationTableName<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #001080\">dataTable<\/span><span style=\"color: #000000\">);<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"\u0e2d\u0e37\u0e48\u0e19-\u0e46\">\u0e2d\u0e37\u0e48\u0e19 \u0e46<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0e0a\u0e37\u0e48\u0e2d\u0e1f\u0e34\u0e25\u0e14\u0e4c\u0e41\u0e25\u0e30\u0e1b\u0e23\u0e30\u0e40\u0e20\u0e17\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25(Data Type) \u0e41\u0e15\u0e48\u0e25\u0e30\u0e04\u0e2d\u0e25\u0e31\u0e21\u0e19\u0e4c\u0e43\u0e19\u0e15\u0e32\u0e23\u0e32\u0e07\u0e41\u0e25\u0e30\u0e42\u0e21\u0e40\u0e14\u0e25\u0e44\u0e1f\u0e25\u0e4c CSV \u0e15\u0e49\u0e2d\u0e07\u0e15\u0e23\u0e07\u0e01\u0e31\u0e19<\/li>\n\n\n\n<li>\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e17\u0e33 Column Mapping \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e40\u0e2d\u0e32\u0e40\u0e09\u0e1e\u0e32\u0e30 Column \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23 Insert \u0e25\u0e07\u0e15\u0e32\u0e23\u0e32\u0e07\u0e44\u0e14\u0e49<\/li>\n<\/ul>\n","protected":false},"featured_media":0,"parent":1404,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"nav_title":"","positive":"","negative":"","footnotes":""},"docs_category":[],"class_list":["post-1406","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/comments?post=1406"}],"version-history":[{"count":3,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1406\/revisions"}],"predecessor-version":[{"id":3207,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1406\/revisions\/3207"}],"up":[{"embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/1404"}],"wp:attachment":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/media?parent=1406"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs_category?post=1406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}