T
TakeshiKitano
Guest
Hi all,
I really don't know what to do. Everything should be ok, but it isn't.
Don't know where in my code is mistake ... please, can you help me? Error> database file is locked ...
private void btnSave_Click(object sender, RoutedEventArgs e)
{
try
{
using (SQLiteConnection con = new SQLiteConnection(conString))
{
con.Open();
using (SQLiteCommand cmd = new SQLiteCommand())
{
string d = String.Empty;
for (int i = 0; i < dtgDocumens.Items.Count; i++)
{
d = "INSERT INTO Documents (document) VALUES (" +
"'" + (dtgDocuments.Items as Documents).dokument + "'" +
");";
cmd.Connection = con;
cmd.CommandText = d;
cmd.ExecuteNonQuery();
}
}
MessageBox.Show("OK");
}
}
catch (Exception ex)
{
MessageBox.Show("Error: " + ex.Message);
}
}
Continue reading...
I really don't know what to do. Everything should be ok, but it isn't.
Don't know where in my code is mistake ... please, can you help me? Error> database file is locked ...
private void btnSave_Click(object sender, RoutedEventArgs e)
{
try
{
using (SQLiteConnection con = new SQLiteConnection(conString))
{
con.Open();
using (SQLiteCommand cmd = new SQLiteCommand())
{
string d = String.Empty;
for (int i = 0; i < dtgDocumens.Items.Count; i++)
{
d = "INSERT INTO Documents (document) VALUES (" +
"'" + (dtgDocuments.Items as Documents).dokument + "'" +
");";
cmd.Connection = con;
cmd.CommandText = d;
cmd.ExecuteNonQuery();
}
}
MessageBox.Show("OK");
}
}
catch (Exception ex)
{
MessageBox.Show("Error: " + ex.Message);
}
}
Continue reading...