資源簡介
c# sql批量導入數據
代碼片段和文件信息
using?System;
using?System.Data;
using?System.Data.SqlClient;
using?System.Diagnostics;
using?System.Text;
namespace?ConsoleAppBatInsert
{
????class?Program
????{
????????static?readonly?string?StrConnMsg?=?“server=.;database=CarSYS;uid=sa;pwd=1127“;
????????static?readonly?long?totalRow?=?1000000;
????????static?readonly?int?getRow?=?1000;
????????static?void?Main(string[]?args)
????????{
????????????InsertOne();
????????????//InsertTwo();
????????????//InsertThree();
????????????//InsertFour();
????????????Console.WriteLine(“插入數據結束“);
????????????Console.ReadLine();
????????}
????????#region?方式一
????????static?void?InsertOne()
????????{
????????????Console.WriteLine(“采用一條一條插入的方式實現“);
????????????Stopwatch?sw?=?new?Stopwatch();
????????????using?(SqlConnectio
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1026??2016-12-08?15:08??ConsoleAppBatInsert.sln
?????文件????????234??2016-12-08?16:02??ConsoleAppBatInsert\App.config
?????文件???????9216??2016-12-09?10:15??ConsoleAppBatInsert\bin\Debug\ConsoleAppBatInsert.exe
?????文件????????234??2016-12-08?16:02??ConsoleAppBatInsert\bin\Debug\ConsoleAppBatInsert.exe.config
?????文件??????17920??2016-12-09?10:15??ConsoleAppBatInsert\bin\Debug\ConsoleAppBatInsert.pdb
?????文件??????24224??2016-12-09?10:10??ConsoleAppBatInsert\bin\Debug\ConsoleAppBatInsert.vshost.exe
?????文件????????234??2016-12-08?16:02??ConsoleAppBatInsert\bin\Debug\ConsoleAppBatInsert.vshost.exe.config
?????文件????????490??2015-10-30?15:19??ConsoleAppBatInsert\bin\Debug\ConsoleAppBatInsert.vshost.exe.manifest
?????文件???????2580??2016-12-08?15:08??ConsoleAppBatInsert\ConsoleAppBatInsert.csproj
?????文件????????592??2016-12-09?10:10??ConsoleAppBatInsert\obj\Debug\ConsoleAppBatInsert.csproj.FileListAbsolute.txt
?????文件???????1755??2016-12-08?16:02??ConsoleAppBatInsert\obj\Debug\ConsoleAppBatInsert.csprojResolveAssemblyReference.cache
?????文件???????9216??2016-12-09?10:15??ConsoleAppBatInsert\obj\Debug\ConsoleAppBatInsert.exe
?????文件??????17920??2016-12-09?10:15??ConsoleAppBatInsert\obj\Debug\ConsoleAppBatInsert.pdb
?????文件???????6610??2016-12-08?15:08??ConsoleAppBatInsert\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件??????????0??2016-12-08?15:08??ConsoleAppBatInsert\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
?????文件??????????0??2016-12-08?15:08??ConsoleAppBatInsert\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
?????文件??????????0??2016-12-08?15:08??ConsoleAppBatInsert\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
?????文件???????6796??2016-12-09?10:28??ConsoleAppBatInsert\Program.cs
?????文件???????1362??2016-12-08?15:08??ConsoleAppBatInsert\Properties\AssemblyInfo.cs
?????目錄??????????0??2016-12-08?15:08??ConsoleAppBatInsert\obj\Debug\TempPE
?????目錄??????????0??2016-12-08?16:02??ConsoleAppBatInsert\bin\Debug
?????目錄??????????0??2016-12-09?10:15??ConsoleAppBatInsert\obj\Debug
?????目錄??????????0??2016-12-08?15:08??ConsoleAppBatInsert\bin
?????目錄??????????0??2016-12-08?15:08??ConsoleAppBatInsert\obj
?????目錄??????????0??2016-12-08?15:08??ConsoleAppBatInsert\Properties
?????目錄??????????0??2016-12-09?10:28??ConsoleAppBatInsert
-----------?---------??----------?-----??----
???????????????100409????????????????????26
評論
共有 條評論