Advertisement
calfred2808

vb.net sqlite

Sep 22nd, 2018
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.68 KB | None | 0 0
  1.  
  2.     Public Sub createDB()
  3.         Dim VarLoc As String = "C:\IC\ACK\DB\"
  4.         Dim VarFile As String = "ICack.db"
  5.         Dim Dir As String = VarLoc + VarFile
  6.  
  7.  
  8.         Dim SQLconnect As New SQLite.SQLiteConnection()
  9.         Dim SQLcommand As SQLiteCommand
  10.         SQLconnect.ConnectionString = "Data Source=" & Dir & ";"
  11.         SQLconnect.Open()
  12.         SQLcommand = SQLconnect.CreateCommand
  13.         'SQL query to Create Table
  14.         SQLcommand.CommandText = "CREATE TABLE myTable(id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, description TEXT, image BLOB);"
  15.         SQLcommand.ExecuteNonQuery()
  16.         SQLcommand.Dispose()
  17.         SQLconnect.Close()
  18.  
  19.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement