我有这个代码:
SqlCeConnection connection = new SqlCeConnection(conString);
connection.Open();
connection.CreateCommand();
cmd.CommandText = "CREATE TABLE Settings (id int IDENTITY PRIMARY KEY, host nvarchar(50), port int, rk_host nvarchar(50), rk_port int, stationcode int, guesttypecode int)";
cmd.ExecuteNonQuery();
cmd = connection.CreateCommand();
cmd.CommandText = "INSERT INTO Settings ([host], [port], [rk_host], [rk_port], [stationcode], [guesttypecode]) VALUES ('" + Settings.host + "', '" + Settings.rk_host + "', '" + Settings.rk_port + "', '" + Settings.port + "', '" + Settings.stationcode + "', '" + Settings.guesttypecode + "')";
cmd.ExecuteNonQuery();
connection.Close();
在第二个ExecuteNonQuery
我有一个例外:"Data conversion failed. [ OLE DB status value (if known) = 2 ]"
有谁能够帮助我?