SqlServerDbHelper_dotNET 1.0.1

.NET Framework 4.0
There is a newer version of this package available.
See the version list below for details.
dotnet add package SqlServerDbHelper_dotNET --version 1.0.1
NuGet\Install-Package SqlServerDbHelper_dotNET -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="SqlServerDbHelper_dotNET" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SqlServerDbHelper_dotNET --version 1.0.1
#r "nuget: SqlServerDbHelper_dotNET, 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.
// Install SqlServerDbHelper_dotNET as a Cake Addin
#addin nuget:?package=SqlServerDbHelper_dotNET&version=1.0.1

// Install SqlServerDbHelper_dotNET as a Cake Tool
#tool nuget:?package=SqlServerDbHelper_dotNET&version=1.0.1

Example: using SqlServerDbHelper;

string server = @"INSTANCE\SQLEXPRESS"; string database = "DEMODB"; string username = "sa"; string password = "";

string connectionString = @"Data Source="+ server + ";Initial Catalog="+ database + "; Trusted_Connection=True;User ID="+ username + ";Password="+ password + ""; DbHelper dbHelper = new DbHelper(connectionString);

Console.WriteLine("IsConnected: " + dbHelper.IsConnected()); if (dbHelper == null || !dbHelper.IsConnected()) { Console.WriteLine("Connessione non valida."); return; } Console.WriteLine("GetVersion: " + dbHelper.GetVersion()); Console.WriteLine("ConnectionString: " + connectionString); Console.WriteLine("GetConnectionTimeout: " + dbHelper.GetConnectionTimeout()); Console.WriteLine("Host: " + dbHelper.Server); Console.WriteLine("Database: " + dbHelper.Database); Console.WriteLine("UserID: " + dbHelper.UserID); Console.WriteLine("Password: " + dbHelper.Password);

string strTableNameAndSchema = "MyDB";

// Skip the backup if already exists if (dbHelper.IfBackupExists(connectionString, strTableNameAndSchema)) return;

string backUpLocation = @"D:\Backup"; string databaseName = strTableNameAndSchema; string backUpFileName = databaseName + "" + DateTime.Now.ToString("ddMMyyyy_HHmm") + "" + "sql2022";

string fileName = @"D:\Backup\backup.bak"; string istname = server;

// Restore if (dbHelper.RestoreDB(fileName, istname, databaseName, server) < 0) Console.WriteLine($"SQL Database Restore Failed");

// Backup if (dbHelper.BackupDatabase(backUpLocation, backUpFileName, databaseName, server, connectionString)) {


// Drop dbHelper.DropDatabase(connectionString);

Product Compatible and additional computed target framework versions.
.NET Framework net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

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.3 320 10/20/2022
1.0.2 365 7/2/2022
1.0.1 352 6/30/2022
1.0.0 428 6/25/2022

Extensions on the SqlServerDB .NetFramework.