DataAccess: use INSERT OR IGNORE for AddBlog to prevent UNIQUE constraint on duplicate blog names
This commit is contained in:
@@ -93,7 +93,7 @@ namespace URLNotesGrabberCORE
|
|||||||
{
|
{
|
||||||
connection.Open();
|
connection.Open();
|
||||||
|
|
||||||
string sql = "INSERT INTO Blogs (BlogName) values('" + blogName + "')";
|
string sql = "INSERT OR IGNORE INTO Blogs (BlogName) values('" + blogName + "')";
|
||||||
SQLiteCommand command = new SQLiteCommand(sql, connection);
|
SQLiteCommand command = new SQLiteCommand(sql, connection);
|
||||||
|
|
||||||
command.ExecuteNonQuery();
|
command.ExecuteNonQuery();
|
||||||
|
|||||||
Reference in New Issue
Block a user