I just found a bug in the SQLite.NET library. I have a function which returns an array of strings with the contents of the Select command. The code is as follows:
string selectSQL = "SELECT id, token FROM Files WHERE (name LIKE 'Client.rar') AND (folder_id IN (SELECT id FROM Directories WHERE Path || name || '\' LIKE 'C:\Documents and Settings\Django\'))";
SQLiteCommand selectCommand = new SQLiteCommand(selectSQL, sqliteCon);
SQLiteDataReader dataReader = selectCommand.ExecuteReader();
bool results = dataReader.Read();
if (results == true)
{
List<string> list = new List<string>();
for (int i = 0; i < dataReader.FieldCount; i++)
{
string field = dataReader[i].ToString();
list.Add(field);
}
string[] arr = list.ToArray();
dataReader.Close();
sqliteCon.Close();
return arr;
}
else
{
string[] arr = { "" };
return arr;
}
To view the database using SQLite Data Browser program. The fact is that the query in the previous software works, and in my C # application returns an empty result.
Anyone know where is that? It seems that everything is correct
Greetings!
field, and inlistif thearrvariable is null or empty then try this insteadstring[] arr = {};arr = list.ToArray();`