I created a serverless database (SQLite) and i can successfully read and write on it when the db is stored locally.
ImpersonationHelper.Impersonate(domain, userName, userPassword, delegate
{ try { if (System.IO.File.Exists(GlobalVar.NetworkPath)) {
SQLiteCommand cmd;
sqlite.Open(); //Initiate connection to the db
cmd = sqlite.CreateCommand();
sqlite.Close();
picConnectionStatus.Image = Properties.Resources.icons8_database_view_64;
lblConnectionEstablished.Text = "Connection Established";
}
}
catch (Exception ex)
{
picConnectionStatus.Image = Properties.Resources.icons8_delete_database_64;
lblConnectionEstablished.Text = "Connection Error";
lblConnectionEstablished.ForeColor = System.Drawing.Color.Red;
}
});
When I store the database to a shared folder i can not access it, probably because i have to provide credentials. i created the class as descripted on that topic and tryed also @Pavel Kovalev's solution with no success, i didn’t manage to use it in this case scenario - How to provide user name and password when connecting to a network share. Any suggestion?