ASP.Net Set Password Protection for SQLite Database

SQLite.dll for .net has inbuilt feature to encrypt the database.
You can set password programatically so whenever someone try to use some GuI to open .db file then it will give error.

Public Shared Function encryptDB(ByVal pwd As String) As String
         'Create Connection String
        Using connection As New SQLiteConnection(System.Configuration.ConfigurationManager.ConnectionStrings("vindb").ConnectionString)
                Return "ok"
            Catch ex As Exception
                Return "Error:" & ex.Message
            End Try
        End Using
    End Function

To access database you have to provide password in connection string of web.config

    [add name="vindb" connectionString="Data Source=|DataDirectory|projxdb.db;Version=3;New=False;Compress=True;password=jeannie"  providerName="System.Data.SqlClient" /]


Most Viewed Post

solution for facebook waiting

Connect Sony XPLOD MEX-BT2500 Bluetooth CD Receiver with ur mobile

Crystal Report : Show data horizontally (Left to right) i.e. columns as rows