objectdatasource具有参数化查询 [英] objectdatasource to have a parameterized query

查看:56
本文介绍了objectdatasource具有参数化查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  SELECT  ElementID,ElementDescription,ElementLiqAFactor,ElementGasAFactor,ElementMetalElements,
   ElementELM,ElementMediaMFR,ElementAdaptorMFR,
   ElementDateStamp,ElementMaint
 FROM  TSElements
位置(元素描述喜欢%claris%)



这是我正在使用的sql命令,我希望对其进行参数化,即仅需要对%claris%进行参数化.我正在使用objectdatasource,并且所有sql函数都存在于xsd文件中.

让我知道您是否有任何想法.谢谢.

解决方案

好吧,我编写了查询,并打算编写与ADO.NET相关的内容,我在此遇到了这篇文章.
似乎在其中说明了您想要的内容:使用SQL参数来克服临时性能问题 [ ^ ]


SELECT ElementID, ElementDescription, ElementLiqAFactor, ElementGasAFactor, ElementMetalElements, 
   ElementELM, ElementMediaMFR, ElementAdaptorMFR, 
   ElementDateStamp, ElementMaint
FROM  TSElements
WHERE (ElementDescription LIKE %claris%)



This is the sql command I am using and I want it to be parameterized i.e. only the %claris% needs to be parameterized. I am using objectdatasource and all the sql functions are present in the xsd file.

Let me know if you have any ideas. Thanks.

解决方案

Well, I wrote the query and was about to write something related to ADO.NET, I came across this article.
Looks like the one you want is explained in it: Use SQL Parameters to Overcome Ad Hoc Performance Issues[^]


这篇关于objectdatasource具有参数化查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆