You haven't said what kind of database you're using but I will assume SQL given the error message.
Name
is a reserved word, and should not be used for column names. Try surrounding it with square brackets
[Name]
to get over this problem at the moment. See also
list of sql reserved words[
^]
Your construction of the string
sql
will leave you open to SQL Injection attacks - even if this is an internal or private piece of coding it is still a good idea to get into good habits ... see
http://www.dotnetperls.com/sqlparameter[
^]