Skip to content

Getting Bool  #9

@afavar

Description

@afavar

Hi, how can i get the boolean value in my database column?

SqliteDatabase sqlDB = new SqliteDatabase ("config.db");
string query = "SELECT bookName ,read " + "FROM Books";
var data = sqlDB.ExecuteQuery (query);
bool boolData = data.Rows[0]["read"];

Currently it returns data.Rows[0]["read"] as object so it gives me an error:
Cannot implicitly convert type object' tobool'. An explicit conversion exists (are you missing a cast?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions