This is a migrated thread and some comments may be shown as answers.

ADO API and IN

1 Answer 49 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
yjh
Top achievements
Rank 1
yjh asked on 23 Sep 2011, 01:29 PM
How to using ADO API to delete records as following:

DELETE FROM TableName WHERE ID IN (@IDS)

In fact that is, how to pass in the parameter "IDS" , assume I want to delete records in table "TableName", and the primary key is "ID", and I have a Guid[] IDS which contains the ID of records to delete.

1 Answer, 1 is accepted

Sort by
0
Accepted
Damyan Bogoev
Telerik team
answered on 26 Sep 2011, 04:27 PM
Hello Yjh,

I am afraid that you are unable to achieve that goal. The OAParameter can only be a single value. Actually you could workaround that by replacing the “@IDS” parameter with the correct GUID values:
query = query.Replace("@IDS", string.Join(guidArray), ","));

Hope that helps.

Greetings,
Damyan Bogoev
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's SQL Server Community Awards. We are competing in TWO categories and every vote counts! VOTE for Telerik NOW >>

Tags
Development (API, general questions)
Asked by
yjh
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or