├── SQL Lite.rar ├── sqllite.unitypackage ├── README.md └── sdb.cs /SQL Lite.rar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/walidabazo/unity-used-SQLite-database/HEAD/SQL Lite.rar -------------------------------------------------------------------------------- /sqllite.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/walidabazo/unity-used-SQLite-database/HEAD/sqllite.unitypackage -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # unity-used-SQLite-database 2 | 3 | To show all videos and download all unity pagackes for free must be Subscriber youtube channel 4 | https://www.youtube.com/channel/UCNJVG9_IebHe-NF-K_Y8Grw?sub_confirmation=1 5 | 6 | 7 | How to read and right on SQLite database , SQLite admin and SQLite Dll windows 32bit and 64bit 8 | 9 | [![Watch the video](https://img.youtube.com/vi/CtDSQkLdlZg/0.jpg)](http://youtu.be/CtDSQkLdlZg) 10 | 11 | [![Watch the video](https://img.youtube.com/vi/swhtUGepAqY/0.jpg)](https://youtu.be/swhtUGepAqY) 12 | 13 | 14 | solving all error in unity for assembly reference: 15 | 16 | error "The type or namespace name `Data' does not exist in the namespace `Mono'. Are you missing an assembly reference?" 17 | 18 | 19 | and error "The type or namespace name `MONO' does not exist in the namespace `Data'. Are you missing an assembly reference?" 20 | 21 | 22 | Notes: 23 | SQLite supported and working on windows 7 32bit and 64bit 24 | 25 | SQLite supported and working on visual studio 2010 26 | 27 | SQLite supported and working with .Net Framework 2.0 28 | ## Good Company hosting and low price VPN 29 | https://shorturl.edafait.com/?fZVHLor 30 | 31 | 32 | 33 | ## Can be start web Augmented reality 34 | 35 | Https://Webxr.edafait.com 36 | -------------------------------------------------------------------------------- /sdb.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using Mono.Data.Sqlite; 5 | using System.Data; 6 | using System; 7 | public class insert : MonoBehaviour { 8 | private string conn, sqlQuery; 9 | IDbConnection dbconn; 10 | IDbCommand dbcmd; 11 | // Use this for initialization 12 | void Start () { 13 | conn = "URI=file:" + Application.dataPath + "/Plugins/Users.s3db"; //Path to database. 14 | //Deletvalue(6); 15 | //insertvalue("ahmedm", "ahmedm@gmail.com", "sss"); 16 | Updatevalue("a","w@gamil.com","1st",1); 17 | readers(); 18 | } 19 | 20 | private void insertvalue(string name, string email, string address) 21 | { 22 | using (dbconn = new SqliteConnection(conn)) 23 | { 24 | dbconn.Open(); //Open connection to the database. 25 | dbcmd = dbconn.CreateCommand(); 26 | sqlQuery = string.Format("insert into Usersinfo (Name, Email, Address) values (\"{0}\",\"{1}\",\"{2}\")",name,email,address);// table name 27 | dbcmd.CommandText = sqlQuery; 28 | dbcmd.ExecuteScalar(); 29 | dbconn.Close(); 30 | } 31 | } 32 | private void Deletvalue(int id) 33 | { 34 | using (dbconn = new SqliteConnection(conn)) 35 | { 36 | dbconn.Open(); //Open connection to the database. 37 | dbcmd = dbconn.CreateCommand(); 38 | sqlQuery = string.Format("Delete from Usersinfo WHERE ID=\"{0}\"", id);// table name 39 | dbcmd.CommandText = sqlQuery; 40 | dbcmd.ExecuteScalar(); 41 | dbconn.Close(); 42 | } 43 | } 44 | 45 | 46 | private void Updatevalue(string name, string email, string address,int id) 47 | { 48 | using (dbconn = new SqliteConnection(conn)) 49 | { 50 | 51 | dbconn.Open(); //Open connection to the database. 52 | dbcmd = dbconn.CreateCommand(); 53 | sqlQuery = string.Format("UPDATE Usersinfo set Name=\"{0}\", Email=\"{1}\", Address=\"{2}\" WHERE ID=\"{3}\" ", name, email, address, id);// table name 54 | dbcmd.CommandText = sqlQuery; 55 | dbcmd.ExecuteScalar(); 56 | dbconn.Close(); 57 | } 58 | } 59 | 60 | 61 | private void readers() 62 | { 63 | using (dbconn = new SqliteConnection(conn)) 64 | { 65 | dbconn.Open(); //Open connection to the database. 66 | dbcmd = dbconn.CreateCommand(); 67 | sqlQuery = "SELECT * " + "FROM Usersinfo";// table name 68 | dbcmd.CommandText = sqlQuery; 69 | IDataReader reader = dbcmd.ExecuteReader(); 70 | while (reader.Read()) 71 | { 72 | int id = reader.GetInt32(0); 73 | string name = reader.GetString(1); 74 | string Email = reader.GetString(2); 75 | string Phone = reader.GetString(3); 76 | 77 | Debug.Log("value= " + id + " name =" + name + " Eamil =" + Email + " Phone" + Phone); 78 | } 79 | reader.Close(); 80 | reader = null; 81 | dbcmd.Dispose(); 82 | dbcmd = null; 83 | dbconn.Close(); 84 | dbconn = null; 85 | } 86 | } 87 | 88 | // Update is called once per frame 89 | void Update () { 90 | 91 | } 92 | } 93 | --------------------------------------------------------------------------------