New Posts New Posts RSS Feed: Help  PassthruEsqlQuery
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Help PassthruEsqlQuery

 Post Reply Post Reply
Author
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Topic: Help PassthruEsqlQuery
    Posted: 17-Sep-2010 at 1:19pm
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.
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 17-Sep-2010 at 12:37pm
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.

Back to Top
Molinari View Drop Down
Groupie
Groupie
Avatar

Joined: 25-Aug-2010
Posts: 42
Post Options Post Options   Quote Molinari Quote  Post ReplyReply Direct Link To This Post Posted: 17-Sep-2010 at 12:15pm
I have no idea, because EntityManager does not has ExecuteCommand or something like method in DevForce2010.

And using PassthruEsqlQuery I am not getting sucess;

thanks...
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 17-Sep-2010 at 11:46am
I think this post can help you get some idea on how you can do that.

Back to Top
Molinari View Drop Down
Groupie
Groupie
Avatar

Joined: 25-Aug-2010
Posts: 42
Post Options Post Options   Quote Molinari Quote  Post ReplyReply Direct Link To This Post Posted: 17-Sep-2010 at 11:19am

I do not want to search all the data
so i can delete, I want delete without search.

using your suggestion, I can do this?

Thanks Denisk....

Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 17-Sep-2010 at 10:21am
My suggestion is to use our EntityManager.RemoveEntity and .RemoveEntities.
Back to Top
Molinari View Drop Down
Groupie
Groupie
Avatar

Joined: 25-Aug-2010
Posts: 42
Post Options Post Options   Quote Molinari Quote  Post ReplyReply Direct Link To This Post Posted: 17-Sep-2010 at 9:55am
Hi Denisk...

You have some idea.
to resolve this?

thanks...
Back to Top
Molinari View Drop Down
Groupie
Groupie
Avatar

Joined: 25-Aug-2010
Posts: 42
Post Options Post Options   Quote Molinari Quote  Post ReplyReply Direct Link To This Post Posted: 17-Sep-2010 at 5:12am
OK... Denisk

Thanks...
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 16-Sep-2010 at 7:45pm
Hi Molinari;

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.

Back to Top
Molinari View Drop Down
Groupie
Groupie
Avatar

Joined: 25-Aug-2010
Posts: 42
Post Options Post Options   Quote Molinari Quote  Post ReplyReply Direct Link To This Post 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);
});

Thanks
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down