I am kinda noob in programming, and I was wondering what I have done wrong here - can some one help me out?
I am making a console app in which it syncs two databases, but when I try to insert the data into the table it throws this exception; The code is:
public static void AddInterationPath(SqlConnection conDS_ReleaseCri, DataRow dr)
{
SqlCommand insertNewAreaPath = new SqlCommand("INSERT INTO InterationPath (ID,NodePath) VALUES(" + dr[0].ToString() + ",'" + dr[2].ToString() + "')", conDS_ReleaseCriterions);
insertNewAreaPath.ExecuteNonQuery();
}
public static void AddAreaPath(SqlConnection conDS_ReleaseCri, DataRow dr)
{
SqlCommand insertNewAreaPath = new SqlCommand("INSERT INTO AreaPath (ID,NodePath) VALUES(" + dr[0].ToString() + ",'" + dr[2].ToString() + "')", conDS_ReleaseCriterions);
insertNewAreaPath.ExecuteNonQuery();
}
And I get the following exception:
incorrect syntax near 's'. unclosed quotation mark after the character string ')'