Hello
I'm trying to add a record to a SQLite database. I want to insert if not exist or replace if changes to existing record
exist. The columns are BName, LastName, FirstName, MiddleName to check if exist the following code is the Query
String. I get a syntax error near "where".Can anyone help me please.
string Query = "INSERT or REPLACE into Info(BName, LastName, FirstName, MiddleName, StreetAddress, City, State, ZipCode, LandLine1, LandLine2, LandLine3, LandLine4, LandLine5, CellPhone1, CellPhone2, CellPhone3, CellPhone4, CellPhone5, Email1, Email2, Email3, Email4, Email5, Email6, Email7, Email8, Email9, Email10) values('" + this.BName.Text + "','" + this.LastName1.Text + "', '" + this.FirstName1.Text + "', '" + this.MiddleName1.Text + "', '" + this.StreetAddress1.Text + "', '" + this.City1.Text + "','" + this.State1.Text + "', '" + this.ZipCode1.Text + "', '" + this.LandLine11.Text + "', '" + this.LandLine21.Text + "','" + this.LandLine31.Text + "', '" + this.LandLine41.Text + "', '" + this.LandLine51.Text + "', '" + this.CellPhone11.Text + "', '" + this.CellPhone21.Text + "', '" + this.CellPhone31.Text + "','" + this.CellPhone41.Text + "', '" + this.CellPhone51.Text + "', '" + this.Email11.Text + "', '" + this.Email21.Text + "', '" + this.Email31.Text + "', '" + this.Email41.Text + "', '" + this.Email51.Text + "', '" + this.Email61.Text + "', '" + this.Email71.Text + "', '" + this.Email81.Text + "', '" + this.Email91.Text + "', '" + this.Email101.Text + "') WHERE [BName] = '" + this.BName.Text + "', [LastName] = '" + this.LastName1.Text + "', [FirstName] = '" + this.FirstName1.Text + "', [MiddleName] = '" + this.MiddleName1.Text + "'";michael r demulling