wfsql 1.4.0

dotnet add package wfsql --version 1.4.0
NuGet\Install-Package wfsql -Version 1.4.0
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="wfsql" Version="1.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add wfsql --version 1.4.0
#r "nuget: wfsql, 1.4.0"
#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 wfsql as a Cake Addin
#addin nuget:?package=wfsql&version=1.4.0

// Install wfsql as a Cake Tool
#tool nuget:?package=wfsql&version=1.4.0

WFSQL

WFSQL is a simple library to simplify working with a SQL Server database in a C# Windows Forms application

About this library

The library includes classes with methods that can be used for:

  • Filling the DataGridView with data obtained from the database using SELECT queries
  • Filling the ComboBox with data obtained from the database using SELECT queries
  • Performing INSERT, DELETE and UPDATE queries to the database

The library includes interface with method that can be used to:

  • Notify the parent form of an event in the child form

How to use this library:

To get started, install this library using PackageManager:

Install-Package wfsql -Version 1.4.0

Or using .NET CLI:

dotnet add package wfsql --version 1.4.0

After installing the NuGet package, you can use the Database class to work with the database.

First, create an instance of the Database class by passing the database connection string as a parameter to its constructor:

private Database database = new Database(@"Data Source=SOME\SQLDATASOURCE;Initial Catalog=SomeDatabase;User ID=SomeUser;Password=SomePassword");

To fill the DataGridView with values from the database, you can use the FillDataGridView method:

database.FillDataGridView("SELECT * FROM SomeTable", someDataGridView);

To fill the ComboBox with values from the database, you can use the FillComboBox method:

database.FillComboBox("SELECT SomeId, SomeName FROM SomeTable", someComboBox, "SomeId", "SomeName");

To perform an INSERT, DELETE or UPDATE query to the database, you can use the ExecuteSqlQuery method:

database.ExecuteSqlQuery("INSERT INTO SomeTable(SomeId, SomeName) VALUES (1, 'NameOfUserWithId1')");
database.ExecuteSqlQuery("UPDATE SomeTable SET SomeName = 'UpdatedName' WHERE SomeId = 1");
database.ExecuteSqlQuery("DELETE FROM SomeTable WHERE SomeId = 1");

The source code of this library can be found on GitHub. An example of a Windows Forms application using the classes of this library is presented in the sample folder in the Github repository.

Product Compatible and additional computed target framework versions.
.NET Framework net is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

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.4.0 425 6/28/2022
1.2.0 399 6/28/2022