Database Error (Sqlite) in unity 4.0

Assets/Scripts/Database.js(12,21): BCE0018: The name ‘IDbConnection’ does not denote a valid type (‘not found’). Did you mean ‘System.Runtime.InteropServices.ComTypes.ITypeComp’?

Assets/Scripts/Database.js(13,21): BCE0018: The name ‘IDbCommand’ does not denote a valid type (‘not found’). Did you mean ‘System.Runtime.InteropServices.ComTypes.ITypeComp’?

Assets/Scripts/Database.js(14,22): BCE0018: The name ‘IDataReader’ does not denote a valid type (‘not found’).

Post code.

Have you import the necessary package containing the definition of IDbConnection?

Yes , I have imported necessary packages. import UnityEngine; import System; import System.Collections; import System.Data; import System.Data.Linq; import Mono.Data.Sqlite; import DbLinq; Also , If i put my script in Plugins/Editor folder or Assets/Editor folder , the errors are gone. But then I cant access this script in other scripts . I dont understand this.

After putting my script in Editor folder, All errors are gone. Then I access my script as following : var db : Database = new Database(); db.OpenDB(); And I got the error : BCE0018: The name 'Database' does not denote a valid type ('not found').

Try to use other title. Please help me to solve this in unity 4.0 seems too vague, potential answerers may just move on without even coming into this page. Use more specific title like "Database Error", "Missing IDbConnection" etc.

1 Answer

1

Put Mono.Data.Sqlite.dll , Mono.Data.SqliteClient.dll , sqlite3.dll and System.Data.dll into Plugins folder.

Dont put Database in Editor Folder. Put it anywhere else