Error on displaying data from Sqlite database

Hello Good Evening. . Im still noob in unity please help me sensei. T.T Im working on my thesis right now im having a problem in displaying text from qslite database. everytime i run my project i get these error:

InvalidCastException: Cannot cast from source type to destination type.
Mono.Data.Sqlite.SqliteDataReader.VerifyType (Int32 i, DbType typ)
Mono.Data.Sqlite.SqliteDataReader.GetInt32 (Int32 i)
WasteManager.GetWasteInfo () (at Assets/Script/WasteManager.cs:63)
WasteManager.DisplayInfo () (at Assets/Script/WasteManager.cs:77)
WasteManager.Start () (at Assets/Script/WasteManager.cs:21)

Sombody please help meee. . I am badly need your help. Hoping for your positive response guys. thank you.
Here is the code:

using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;

class Waste{
	public int ID { get; set; }

	public string Name { get; set; }
	
	public string Info { get; set; }
	
	public string time { get; set; }
	
	public int wEffect { get; set; }
	
	public int cEffect { get; set; }
	
	public string category { get; set; }
	
	public string reference { get; set; }
	

	
	public Waste(int wID, string wname, string wfacts, string timeD, int waterE, int coralE, string wcateg, string refe){
		this.ID = wID;
		this.Name = wname;
		this.Info = wfacts;
		this.time = timeD;
		this.wEffect = waterE;
		this.cEffect = coralE;
		this.category = wcateg;
		this.reference = refe;
	}
	
}

using UnityEngine;
using System.Collections;
using System;
using System.Data;
using Mono.Data.Sqlite;
using System.Collections.Generic;

public class WasteManager : MonoBehaviour {
	
	private string connectionString;
	private List<Waste> wastes = new List<Waste>();// store high score in a list

	public GameObject wasteInformation;

	public Transform wasteInfoParent;

	// Use this for initialization
	void Start () {
		connectionString = "URI=file:" + Application.dataPath + "/WasteInfoDB.sqlite";
			DisplayInfo ();
	}

	void Update () {//


		
	}


		private void GetWasteInfo(){ // GetWasteInfo

		wastes.Clear ();

		using (IDbConnection dbConnection = new SqliteConnection(connectionString)) {
			dbConnection.Open ();

			using (IDbCommand dbCmd = dbConnection.CreateCommand()) {
				string sqlQuery = "SELECT * FROM WasteFacts";

				dbCmd.CommandText = sqlQuery;

				using (IDataReader reader = dbCmd.ExecuteReader()) {
					while (reader.Read()) {

					wastes.Add(new Waste(reader.GetInt32(0), reader.GetString(1), reader.GetString(5), reader.GetString(2), reader.GetInt32(3), reader.GetInt32(4), reader.GetString(7), reader.GetString(6)));

	
					}

				
					dbConnection.Close ();
					reader.Close ();
					}
				}
			}
		}

		private void DisplayInfo(){
			GetWasteInfo ();
		for (int i = 0; i < wastes.Count; i++) {
			GameObject tmpObject = Instantiate(wasteInformation);
			Waste tmpWaste = wastes*;*
  •  	tmpObject.GetComponent<wasteScript>().SetWaste(tmpWaste.Name, tmpWaste.category, tmpWaste.Info, tmpWaste.wEffect.ToString(), tmpWaste.cEffect.ToString(), tmpWaste.time);*
    
  •  	tmpObject.transform.SetParent(wasteInfoParent);*
    
  •  }*
    
  •  }*
    

}
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class wasteScript : MonoBehaviour {

  • public GameObject wn;*
  • public GameObject wc;*
  • public GameObject wd;*
  • public GameObject we;*
  • public GameObject ce;*
  • public GameObject td;*
  • public void SetWaste(string WN, string WC, string WD, string WE, string CE, string TD){*
  •   this.wn.GetComponent<Text> ().text = WN;*
    
  •   this.wc.GetComponent<Text> ().text = WC;*
    
  •   this.wd.GetComponent<Text> ().text = WD;*
    
  •   this.we.GetComponent<Text> ().text = WE;*
    
  •   this.ce.GetComponent<Text> ().text = WC;*
    
  •   this.td.GetComponent<Text> ().text = TD;*
    
  • }*
    }

I’m having the very same problem. Have you found a solution to this?

InvalidCastException: Cannot cast from source type to destination type.
Mono.Data.Sqlite.SqliteDataReader.VerifyType (Int32 i, DbType typ)
Mono.Data.Sqlite.SqliteDataReader.GetInt32 (Int32 i)
DatabaseManager.GetAssignments () (at Assets/Scripts/DatabaseManager.cs:70)
DatabaseManager.Start () (at Assets/Scripts/DatabaseManager.cs:26)

while (reader.Read ())
					{
						assignments.Add(new Assignment(reader.GetInt32(0), reader.GetString(1), reader.GetDateTime(2), reader.GetInt32(3)));
					}

This seems to be where the problem is. It’s where Unity points to anyway. It’s definitely that last reader. I took out all the other readers and added them back in one by one. Once I got to that last one, it threw the error.

A bit late to the party here I know.

But was worked for me was creating a new class with an int property and create a new instance of it and putting the sqlite result in there.
Not sure why there’s so much hassle when trying to cast it to an int but it works fine if a class property is an int.