cancel
Showing results for 
Search instead for 
Did you mean: 

ASE Data Adapeter -ExecuteReader()

0 Kudos

Hi,

does ASE Data Adapeter supports second SelectCommand.ExecuteReader() after execution been canceled, on the same object?

Thank you for answer.
Jakub Kremer

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Thank you, yes i need to create new adapter to run the select again.

Also we are experiencing the Access Violation Exception

Do you have a idea what can be the issue?

Thanks. J.

dawn_kim
Contributor
0 Kudos

Hi,

An access violation occurs in unmanaged or unsafe code when the code attempts to read or write to memory that has not been allocated

Thanks,
Dawn Kim
ryan_hansen
Employee
Employee
0 Kudos

Hi,

If you call adapter.SelectCommand.Cancel() this will cause the next adapter.SelectCommand.ExecuteReader() to fail with exception:
"Operation Canceled."

AseDataAdapter adapter= new AseDataAdapter();
AseCommand cmd = new AseCommand("select a.au_lname from authors a, authors b, authors c, authors d", conn);
adapter= new AseDataAdapter(cmd);

adapter.SelectCommand.ExecuteReader();

System.Threading.Thread.Sleep(2000);
adapter.SelectCommand.Cancel();

System.Threading.Thread.Sleep(2000);
adapter.SelectCommand.ExecuteReader();

Regards,
Ryan