How to use the varchar data type in c#?
c#
Solution
There is no `varchar` type in C#.
A `varchar` is pretty much a string (of variable length in SQL, obviously), so what you have is fine.
Problem
I have this piece of code and I want to make it varchar not string. What is the appropriate syntax to do that in c# ``` string emri = row["Nome"].ToString(); ``` I have a query that I have to run and I use emri in it and compare it with a column in table which I have created in mysql. the column in mysql is of type varchar(20). When I execute my code it gives an error in my query and I was guessing maybe it was for this reason ``` I have this query string query = "IF NOT EXISTS(SELECT * FROM clienti WHERE CodCliente= " + id + " AND Nome = '" + emri + "' AND RagioneSociale=' " + ragSoc + " ' AND PartitaIVA=' " + piva + " ') INSERT INTO clienti VALUES(" + id + " ,' " + emri + " ',' " + ragSoc + " ',' " + piva + " ') else UPDATE clienti SET( " + id + " ,' " + emri + " ',' " + ragSoc + " ',' " + piva + " ')"; ``` and it gives me this problem ``` You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF NOT EXISTS(SELECT * FROM clienti WHERE CodCliente= 1 AND NomeCliente = 'Jo' at line 1 ```