Here is the Code:
public long AddCase(Customer addCust)
{
using (var db1 = new SQLiteConnection(_helper.WritableDatabase.Path)) //Null Exception:Error
{
try
{
return db1.Insert(addCust);
}
catch (Exception ex)
{
//catch Exception;
}
}
}
I am trying to invoke the above function with the code below
DatabaseUpdates ManageDb = new DatabaseUpdates();
ManageDb.SetContext(this);
DatabaseUpdates upd = new DatabaseUpdates();
upd.UpdateCustomer(var);
Name.Text = "";
. . I have a function to check if _helper is null or not..,
if (context != null)
{
_helper = new DataManagerHelper(context);
}
Well I want to know what actually SQLiteConnection(dbpath) means. Why its showing null Exception. I know the concept why it declares null exception. Please help me understand why the below code gives me an error,
**using (var db1 = new SQLiteConnection(_helper.WritableDatabase.Path)) //Null Exception:Error**
No build errors. There are debug errors. Please help