ExcelToSqlAutotablecreate 1.0.1
dotnet add package ExcelToSqlAutotablecreate --version 1.0.1
NuGet\Install-Package ExcelToSqlAutotablecreate -Version 1.0.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ExcelToSqlAutotablecreate" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ExcelToSqlAutotablecreate" Version="1.0.1" />
<PackageReference Include="ExcelToSqlAutotablecreate" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ExcelToSqlAutotablecreate --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ExcelToSqlAutotablecreate, 1.0.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ExcelToSqlAutotablecreate@1.0.1
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ExcelToSqlAutotablecreate&version=1.0.1
#tool nuget:?package=ExcelToSqlAutotablecreate&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ExcelToSqlAutotablecreate
A lightweight .NET library to import Excel files into SQL Server automatically.
It uses ClosedXML to read Excel files and SqlBulkCopy to insert data into SQL Server.
If the table does not exist, it will be created automatically using Excel headers.
Features
- Auto-create SQL Server tables from Excel headers.
- Bulk insert data using SqlBulkCopy.
- Simple API – provide Excel path, table name, and connection string.
Installation
Install-Package ExcelToSqlAutotablecreate
or
dotnet add package ExcelToSqlAutotablecreate
Usage Example (Console App)
using ExcelToSqlAutotablecreate;
string connectionString = "Server=.;Database=YourDb;Trusted_Connection=True;";
var excelToSql = new ExcelToSqlService(connectionString);
// Import Excel -> Creates table if not exists -> Inserts data
excelToSql.ImportExcelAndCreateTable(@"C:\path\to\file.xlsx", "MyTable");
Usage Example (ASP.NET Core API)
[HttpPost("import")]
public async Task<IActionResult> ImportExcel(IFormFile file, string tableName)
{
var tempPath = Path.GetTempFileName();
using (var stream = new FileStream(tempPath, FileMode.Create))
{
await file.CopyToAsync(stream);
}
var importer = new ExcelToSqlService(_connectionString);
importer.ImportExcelAndCreateTable(tempPath, tableName);
return Ok("Excel imported successfully!");
}
Notes
- All columns are created as NVARCHAR(MAX).
- Works with SQL Server only.
License
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- ClosedXML (>= 0.105.0)
- System.Data.SqlClient (>= 4.9.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.1 | 208 | 8/21/2025 |