https://github.com/kris701/databasesharp
A project to interface and convert values to database STPs
https://github.com/kris701/databasesharp
csharp database
Last synced: 4 months ago
JSON representation
A project to interface and convert values to database STPs
- Host: GitHub
- URL: https://github.com/kris701/databasesharp
- Owner: kris701
- License: mit
- Created: 2024-08-22T09:42:01.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-12-17T10:07:09.000Z (7 months ago)
- Last Synced: 2025-12-31T06:18:34.848Z (6 months ago)
- Topics: csharp, database
- Language: C#
- Homepage:
- Size: 101 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://github.com/kris701/DatabaseSharp/actions/workflows/dotnet-desktop.yml)







# DatabaseSharp
This is a project to introduce simpler type conversion when communicating with a database.
The library here is designed to only communicate through STPs, since it is considered more secure than free SQL.
An example of how this works can be seen below:
```csharp
var client = new DBClient("<--Database Connection String Here-->");
var dataset = await client.ExecuteAsync("some-stp");
var table = dataset[0];
var row = table[0];
int someValue = row.GetValue("COL_NAME");
```
You can also deserialize directly into class objects like this:
```csharp
public class SomeClass
{
[DatabaseSharp(ColumnName = "PK_NAME")]
public string Name { get; set; }
[DatabaseSharp(ColumnName = "ACT_VALUE")]
public int Value { get; set; }
}
var client = new DBClient("<--Database Connection String Here-->");
var dataset = await client.ExecuteAsync("some-stp");
var table = dataset[0];
var row = table[0];
SomeClass filled = row.Fill();
```
These are just the methods on the row level.
However you can also use these on the Table level, where it will instead make a list of the items, as such:
```csharp
var client = new DBClient("<--Database Connection String Here-->");
var dataset = await client.ExecuteAsync("some-stp");
var table = dataset[0];
List someValue = table.GetAllValues("COL_NAME");
```
The project is available as a package on the [NuGet Package Manager](https://www.nuget.org/packages/DatabaseSharp/).