Hi guys! Can anyone help with this?
I have a sql database in my StreamingAssets folder and I am trying to retrieve the data using linq.
Here is my code:
using UnityEngine;
using System.Linq;
public class EnglishScript : MonoBehaviour
{
void Start()
{
// Connect to database
var ds = new DataService("English.db");
// Retrieve data
var linqQuery = from Questions in "English.db"
select Questions;
string sqlQuery = linqQuery.ToString();
Debug.Log(sqlQuery);
}
}
The problem is that instead of data, I get this in my console:
System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[System.Char,System.Char]
UnityEngine.Debug:Log(Object)
EnglishScript:Start() (at Assets/Scripts/EnglishScript.cs:21)
Any ideas what I am doing wrong? Many thanks for any help!