1
PDA (WM 6) 용 응용 프로그램을 만들고 있습니다.
데이터베이스에 데이터를 삽입하려고하면이 오류가 항상 발생합니다.SQL CE 삽입 오류
오류 :
There was an error parsing the query. [ Token line number = 1,Token line offset = 100,Token in error =) ]
코드 :
public static bool InsertPedido(int id, int Vim, DateTime date, int quantidade)
{
SqlCeConnection conn = new SqlCeConnection("Data Source=" + System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + @"\\DataPedido.sdf; Password =SUPER2000PED;");
conn.Open();
try
{
SqlCeCommand comando = new SqlCeCommand(@"INSERT INTO Pedido([IDLayout], [Vim], [Data], [Quantidade])VALUES(@IDLayout,@Vim,@Data,@Quantidade))", conn);
comando.Parameters.AddWithValue("@IDLatout", SqlDbType.Int).Value = id;
comando.Parameters.AddWithValue("@Vim", SqlDbType.Int).Value = Vim;
comando.Parameters.AddWithValue("@Data", SqlDbType.DateTime).Value = date;
comando.Parameters.AddWithValue("@Quantidade", SqlDbType.Int).Value = quantidade;
int row = comando.ExecuteNonQuery();
return true;
}
catch
{
throw;
}
finally
{
conn.Close();
}
}
가장 빠른 건 ..'+ 1' –