My project should display data from an sqlite3 database. The database name is db.sqlite3. The error is: Unable to open the database file
here is my code:
public partial class OverviewAdmin : System.Web.UI.Page
{
private SQLiteConnection sql_con;
private SQLiteCommand sql_cmd;
private SQLiteDataAdapter DB;
private DataSet DS = new DataSet();
private DataTable DT = new DataTable();
protected void Page_Load(object sender, EventArgs e)
{
LoadData();
}
private void SetConnection()
{
sql_con = new SQLiteConnection
("Data Source=db.sqlite3;");
}
private void LoadData()
{
SetConnection();
sql_con.Open();
sql_cmd = sql_con.CreateCommand();
string CommandText = "select * from scotty_fahrt";
DB = new SQLiteDataAdapter(CommandText, sql_con);
DS.Reset();
DB.Fill(DS);
DT = DS.Tables[0];
GVOutput.DataSource = DT;
sql_con.Close();
}
Maybe its because of the database file name.