我有点儿编程小白,我想知道我做了什么错在这里 - 能有人帮帮我吗?
我想提出在它同步两个数据库一个控制台应用程序,但是当我尝试将数据插入到表中它抛出该异常; 该代码是:
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();
}
我得到以下异常:
不正确的语法近的。“ 字符串后未闭合的引号“)”