VB.NET Tutorials Create Connections to SQLite Connection String

VB.NET & SQLite Tutorials : how to create a connection to SQLite database using SQLite Ado.NET data , SQLite 3 ODBC driver, .NET Framework as a Data Provider in vb.net

VB.NET & SQLite Tutorials : How to create a connection to SQLite Embedded database using SQLite Ado.NET data , SQLite 3 ODBC driver, .NET Framework as a Data Provider in vb.net? SQLite can handle a connetion from an application like .Net Apps using ADO.NET, ODBC as a Data Provider.

Please read : How to Install SQLite on Windows, Create Database, Table, Columns?

You can follow link above to Download and install SQLite Embedded Database on your computer, If already did, just create your first database using SQLite and we will make a connection from vb.net simple application.

How to create Database, Columns, Field, View, Trigger in SQLite? here simple aplications will help you to Configure your SQLite Embedded Database, "SQL Maestro Group" download from here https://www.sqlmaestro.com/ or use SQLite Administrator, Download Here http://sqliteadmin.orbmu2k.de/

SQL Maestro Group offers complete database management and web development tools for all the most popular DBMS providing the highest performance, scalability and reliability to meet the requirements of today's database applications.

Create New Project (SQLite Connection)

Open your visual studio and create new project and rename it with "SQLiteConnection", now after created, leave your project for a moment, we will create a SQLite database for our project.

Create SQLite Database (Columns, Field, Value)

On this tutrial, we will create SQLite database using SQLite Administrator, just Open your SQLite Administrator and please create new Databases using new name "NewInSQLite" and Save it into your current project, on this tutorial i'll save my new database in : "C:\Users\b0x\Documents\Visual Studio 2015\Projects\NewApp\NewApp\bin\Debug".

Now, we will create Table names for our SQLite Database (tbl_biodata) to our new database "NewinSQLite" and add more field to your table and click CREATE, see images below :

Tutorials Create Connections to SQLite Connection String

 Or you can use this SQL query to crate "tbl_biodata"

CREATE TABLE [tbl_biodata] (
[nama] VARCHAR(50)  NULL,
[nis] NVARCHAR(20)  NULL,
[kelas] VARCHAR(20)  NULL,
[alamat] NVARCHAR(50)  NULL

Source Code Create Connections to SQLite Database

After you already have a SQLite Database, back to our project in visual studio, we will create a connection to our new database.

On the Form1.vb, we must add SQLite Library to our project, we can use Nuget Packages to declare SQLite library, Right click on you project solutions > Manage NuGet Packages for Solutions > and search for the "SQLite", than install it. see image below :

Tutorials Create Connections to SQLite Connection String

Tutorials Create Connections to SQLite Connection String

If you have finished, just write all source code below to crate connection to SQLite Embedded database using VB.NET

Imports System.Data.SQLite ' using SQLite Namespaces
Public Class Form1
    Dim connect As SQLiteConnection ' declare the connection
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        connection() ' call connection Functions
        connect.Close() ' close connection
    End Sub
    Sub connection()
            connect = New SQLiteConnection("Data Source=hc-kr.db") ' Connection DataSource
            If connect.State = ConnectionState.Closed Then
                MsgBox("Connection Success!", MsgBoxStyle.Information, "Informations")
            End If
        Catch ex As Exception
            MsgBox("Failed to connect to SQLite Database", MsgBoxStyle.Information, "Warning")
        End Try
    End Sub
End Class

More String connection to SQLite database :

You can use costum string connection to our connection, see it below :

SQLite Connections with .NET Provider


Connection = "Data Source=c:\mydb.db;Version=3;"

In-Memory Database

Connection = "Data Source=:memory:;Version=3;New=True;"

Using UTF16

Connection = "Data Source=c:\mydb.db;Version=3;UseUTF16Encoding=True;"

With password

Connection = "Data Source=c:\mydb.db;Version=3;Password=myPassword;"

Connect SQLite using ADO.NET


Connection = "Data Source=c:\mydb.db;Version=3;"

SQLite Version 2.x

Data Source=c:\mydb.db;Version=2;"

Create a New Database

Connection = "Data Source=c:\mydb.db;Version=3;New=True;"

Using Compression

Connection = "Data Source=c:\mydb.db;Version=3;Compress=True;"

Connection to SQLite using ODBC Driver

Connection = "DRIVER=SQLite3 ODBC Driver;Database=c:\mydb.db;LongNames=0;Timeout=1000;NoTXN=0;

Download SQLite Connection full source code here https://www.dropbox.com/s/lmh1z8rtc67295w/hc-kr-com-sqlite-connect.zip?dl=0


Feel free to code it up and send us a pull request.

Hi everyone, let's me know how much this lesson can help your work. Please Subscribe and Follow Our Social Media 'kodeajaib[dot]com' to get Latest tutorials and will be send to your email everyday for free!, Just hit a comment if you have confused. Nice to meet you and Happy coding :) all ^^

Follow by E-Mail


ADO.NET,3,Ajax,6,Android,9,AngularJS,4,ASP.NET,4,Blogger Tutorials,7,Bootstrap,7,C++,1,Codeigniter,2,Cplusplus,6,Crystal Report,6,CSharp,25,Ebook Java,2,FlyExam,1,FSharp,3,Game Development,2,Java,35,JDBC,2,Laravel,84,Lumen,2,MariaDB,2,Ms Access,3,MySQL,31,ODBC,6,OleDB,1,PHP,14,PHP Framework,5,PHP MYSQLI,9,PHP OOP,5,Python,8,Python 3,4,SQL Server,4,SQLite,4,Uncategorized,5,Vb 6,2,Vb.Net,89,Video,48,Vue Js,4,WPF,2,Yii,3,
KODE AJAIB: VB.NET Tutorials Create Connections to SQLite Connection String
VB.NET Tutorials Create Connections to SQLite Connection String
VB.NET & SQLite Tutorials : how to create a connection to SQLite database using SQLite Ado.NET data , SQLite 3 ODBC driver, .NET Framework as a Data Provider in vb.net
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy