问题描述
我有,我想通过一个包含IN条款,是接受它的值通过一个参数一个ASP.NET的TableAdapter运行一个查询。
I have a query that I wish to run through an ASP.NET TableAdapter that contains an 'IN' clause which is to receive it's values through a parameter.
我的问题是,我怎么指定此参数?我觉得写的条件语句是这样的:
My question is, how do I specify this parameter? I thought of writing the conditional statement like this:
AND b.group_category_id in (@ParamList)
,其中@ParamList的参数,如:对字符串4,12,45,23,但由于指定的ID是一个整数,它抱怨说,它无法将字符串转换为整数。这是有道理的,但有什么办法可以在一个ASP.NET的TableAdapter指定一个SQL语句,一个列表?
where the @ParamList is a String of the parameters, e.g. "4,12,45,23" but since the specified id is an Integer, it complains that it cannot convert String to Integer. This makes sense, but is there any way to specify such a list in a SQL statement in an ASP.NET TableAdapter?
推荐答案
回答我的问题有:它不能做到
Answering my own question with: it can't be done.
这篇关于ADO.NET的TableAdapter参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!