1 thg 11, 2019

GETTING STARTED WITH LITEDB DATABASE IN C#

This post shows you How to use NoSQL Database in C# using LiteDB database.

LiteDB is a NoSQL database for .NET. It's a small, fast and lightweight NoSQL embedded database, you can download and install it from Nuget Manage Packages in your Visual Studio.
litedb c#
Creating a new Windows Forms Application project, then create a Contact class as shown below.
We will create a simple demo by creating a simple Contact class, then add the Contact object to the LiteDB database.
1
2
3
4
5
6
7
8
public class Contact
{
    public int Id { getset; }
    public string FullName { getset; }
    public string Email { getset; }
    public string Phone { getset; }
    public string Address { getset; }
}
Next, You need to rebuild your project, then open your form designer. Dragging the DataGridView control from the Visual Studio toolbox to your winform, then add a bindingsource to your DataGridView.
Opening your Visual Studio DataSource, then change your control fileds to the TextBox control. Next, Drag all controls from your DataSource to your winform.
You can design a simple UI that allows you to Insert Update Delete and Search data from LiteDB database in C# Windows Forms Application as shown above.
To play the demo, you need to install LiteDB by right-clicking on your project, then select Nuget Manage Packages from your Visual Studio => Search LiteDB => Install it
install litedb via nuget manage packages
or you can install the LiteDB via command line by clicking on Tools menu => NuGet Package Manager => Package Manager Console, then enter the command below.
Install-Package LiteDB
install litedb via package manager console
LiteDB is a library that helps you work with c# embedded database, you can also use litedb .net core.
link web.

GETTING STARTED WITH LITEDB DATABASE IN C# Rating: 4.5 Diposkan Oleh: http://pdunoteit.blogspot.com/