INSERT new record or REPLACE existing record if the primary key already exists

	Command1 = new System.Data.SQLite.SQLiteCommand(Connection1);
	Command1.CommandText = @"INSERT OR REPLACE INTO tblBookCards
								(CardId, CardPicture)
								(@CardId, @CardPicture)";
	Command1.Parameters.AddWithValue("@CardId", CardId);

	if (BookCardImage.Length > 0)
		Command1.Parameters.AddWithValue("@CardPicture", BookCardImage);
		Command1.Parameters.AddWithValue("@CardPicture", DBNull.Value);



Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.


Your email address will not be published.