How to use the varchar data type in c#? -
i have piece of code , want make varchar not string. appropriate syntax in c# string emri = row["nome"].tostring(); i have query have run , use emri in , compare column in table have created in mysql. column in mysql of type varchar(20). when execute code gives error in query , guessing maybe reason i have query string query = "if not exists(select * clienti codcliente= " + id + " , nome = '" + emri + "' , ragionesociale=' " + ragsoc + " ' , partitaiva=' " + piva + " ') insert clienti values(" + id + " ,' " + emri + " ',' " + ragsoc + " ',' " + piva + " ') else update clienti set( " + id + " ,' " + emri + " ',' " + ragsoc + " ',' " + piva + " ')"; and gives me problem you have error in sql syntax; check manual corresponds mysql server version right syntax use...