QuoteReplyTopic: Help PassthruEsqlQuery Posted: 16-Sep-2010 at 8:01am
Hey
I wonder if it's possible to perform a DELETE this way
PassthruEsqlQuery query = new PassthruEsqlQuery(typeof(PESSOA_TIPO_USUARIO_P_RIGHT),
"DELETE FROM PESSOA_TIPO_USUARIO_P_RIGHT WHERE FK_PESSOA_TIPO_USUARIO_PERFIL = 1);
query.ExecuteAsync(op =>
{
if (!op.HasError)
return;
else
MessageBox.Show(op.Error.Message);
});
Entity SQL provides no support for DELETE statement at this time. Please see Microsoft's website below to find out how Entity SQL differs from Transact-SQL.
This approach is generally not recommended and you have to write a work around function that involves writing a wrapper around a Transact-SQL statement. ExecuteCommand is a .NET namespace. Please see below for more info.
Another approach is to invoke a server method using the DF InvokeServerMethod. Inside that server method, you will need to create an ADO.NET connection using the connection string from the config file as well as creating the command objects and execute the DELETE SQL statement.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum