Answer the question
In order to leave comments, you need to log in
What's wrong with the database?
There is a youtube.bytes database in it with a Users table with 3 fields, I try to send and read records there, neither one nor the other comes out, basically the error is Unable to open Assets/youtube.bytes.db: Check external application preferences. there is a try to display an error through try catch writes Mono.Data.Sqlite.SqliteE
how to solve the problem?
SqliteException: SQLite error
no such table: Users
Mono.Data.Sqlite.SQLite3.Prepare(Mono.Data.Sqlite.SqliteConnection cnn, System.String strSql, Mono.Data.Sqlite.SqliteStatement previous, UInt32 timeoutMS, System.String& strRemain)
Mono.Data.Sqlite.SqliteCommand.BuildNextCommand()
UnityEngine.EventSystems.EventSystem:Update()
using System.Collections;
using UnityEngine;
using Mono.Data.Sqlite;
using System.Data;
using System.IO;
using System;
using UnityEngine.UI;
public class db_controller : MonoBehaviour {
public SqliteConnection con_db;
public SqliteCommand cmd_db;
public SqliteDataReader rdr;
public string path;
public Text text;
string id;
string log;
string pass;
public InputField idfield;
public InputField login;
public InputField password;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
public void Connection()
{
path = Application.dataPath + "/youtube.bytes";
con_db = new SqliteConnection ("URI=file:" + path);
con_db.Open ();
}
public void SetDB(){
Connection();
id=idfield.text.ToString();
log=login.text.ToString();
pass=password.text.ToString();
cmd_db=new SqliteCommand("INSERT INTO Users(id,login,pass) VALUES('"+id+"','"+log+"','"+pass+"')", con_db);
cmd_db.ExecuteNonQuery ();
Disconnect();
}
private void Disconnect(){
con_db.Close ();
}
}
Answer the question
In order to leave comments, you need to log in
Unable to open Assets/youtube.bytes.db: Check external application preferences
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question