I’m trying to insert a value into the databse like this:
command.CommandText = "INSERT INTO mail('" + s2[0] + "') values" + "('" + s2[1] + "')";
s2[0] contains the name of the field while s2[1] contains the value.
I want to mention that the string contained in s2[0] matches exactly the name of the field from the table.
What seems to be the problem?
PS: i’d also like to know that exception to throw if the table doesn’t have a field to match s2[0].
just remove extra ‘ from the string after mail
try to use sql command with the sqlParameter