你能确定我的错误在哪里吗?当我运行这个时,我得到一个错误ExecuteNonQuery
'@geoPoint' 附近的语法不正确
sqlConnection.Open();
string commandText = "INSERT INTO shapefileTest (state, nrng, twp, lgnt, type, ntwp, meridian, rdir, tdir, rng, stcty, county, shape) VALUES ('" + state + "', '" + nrng + "', '" + twp + "' , " + lgnt + ", '" + type + "', '" + ntwp + "', '" + meridian + "', '" + rdir + "', '" + tdir + "', '" + rng + "', '" + stcty + "', '" + county + "', @geoPoint";
SqlCommand sqlComm = new SqlCommand(commandText, sqlConnection);
SqlParameter param = new SqlParameter();
param.ParameterName = "@geoPoint";
param.UdtTypeName = "Geography";
param.Value = sqlGeog;
sqlComm.Parameters.Add(param);
sqlComm.ExecuteNonQuery();
sqlConnection.Close();