使用sqlhelper類查詢時假如不需要引數化,那到時SqlParameter這個傳參怎麼處理
阿新 • • 發佈:2019-02-03
我在學寫SqlHelper類。用SqlParameter【】陣列做為引數。
我按條件查詢時,可以弄個引數化
但是查詢時假如並不需要引數化,那到時SqlParameter這個傳參怎麼處理
比如
查詢語句是 “select*from Student”,並不需要寫@id這種命令引數了。
但我定義的函式 ExecuteDataTable()需要傳參SQLParameter型別,怎麼處理啊?
我按條件查詢時,可以弄個引數化
但是查詢時假如並不需要引數化,那到時SqlParameter這個傳參怎麼處理
比如
查詢語句是 “select*from Student”,並不需要寫@id這種命令引數了。
但我定義的函式 ExecuteDataTable()需要傳參SQLParameter型別,怎麼處理啊?
- <iframe id="iframeu1636200_0" src="http://pos.baidu.com/scom?rdid=1636200&dc=2&di=u1636200&dri=0&dis=0&dai=2&ps=995x370&dcb=BAIDU_SSP_define&dtm=HTML_POST&dvi=0.0&dci=-1&dpt=none&tsr=0&tpr=1470575688292&ti=SqlHelper%E5%87%BD%E6%95%B0%E6%9C%89SqlParameter%E5%8F%82%E6%95%B0%EF%BC%8C%E4%BD%86%E4%B8%8D%E9%9C%80%E8%A6%81%E5%8F%82%E6%95%B0%E5%8C%96%E6%9F%A5%E8%AF%A2%E6%97%B6%EF%BC%8C%E6%80%8E%E4%B9%88%E4%BC%A0%E5%8F%82-CSDN%E8%AE%BA%E5%9D%9B-CSDN.NET-%E4%B8%AD&ari=2&dbv=2&drs=3&pcs=1318x625&pss=1318x2952&cfv=18&cpl=28&chi=1&cce=true&cec=UTF-8&tlm=1470575688&rw=625&ltu=http%3A%2F%2Fbbs.csdn.net%2Ftopics%2F391024210&ltr=http%3A%2F%2Fcn.bing.com%2Fsearch%3Fq%3Dsqlhelper%2B%25E5%258F%2582%25E6%2595%25B0%25E5%258C%2596%25E6%259F%25A5%25E8%25AF%25A2&ecd=1&psr=1366x768&par=1366x728&pis=-1x-1&ccd=24&cja=true&cmi=57&col=zh-CN&cdo=-1&tcn=1470575688&qn=e8af64dab90e24c8&tt=1470575688267.33.480.482" width="200" height="22" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" allowtransparency="true" style="box-sizing: content-box; border-width: 0px; vertical-align: bottom; margin: 0px;"></iframe>
- <iframe id="iframeu1636201_0" src="http://pos.baidu.com/scom?rdid=1636201&dc=2&di=u1636201&dri=0&dis=0&dai=3&ps=995x624&dcb=BAIDU_SSP_define&dtm=HTML_POST&dvi=0.0&dci=-1&dpt=none&tsr=0&tpr=1470575688292&ti=SqlHelper%E5%87%BD%E6%95%B0%E6%9C%89SqlParameter%E5%8F%82%E6%95%B0%EF%BC%8C%E4%BD%86%E4%B8%8D%E9%9C%80%E8%A6%81%E5%8F%82%E6%95%B0%E5%8C%96%E6%9F%A5%E8%AF%A2%E6%97%B6%EF%BC%8C%E6%80%8E%E4%B9%88%E4%BC%A0%E5%8F%82-CSDN%E8%AE%BA%E5%9D%9B-CSDN.NET-%E4%B8%AD&ari=2&dbv=2&drs=3&pcs=1318x625&pss=1318x2952&cfv=18&cpl=28&chi=1&cce=true&cec=UTF-8&tlm=1470575688&rw=625&ltu=http%3A%2F%2Fbbs.csdn.net%2Ftopics%2F391024210&ltr=http%3A%2F%2Fcn.bing.com%2Fsearch%3Fq%3Dsqlhelper%2B%25E5%258F%2582%25E6%2595%25B0%25E5%258C%2596%25E6%259F%25A5%25E8%25AF%25A2&ecd=1&psr=1366x768&par=1366x728&pis=-1x-1&ccd=24&cja=true&cmi=57&col=zh-CN&cdo=-1&tcn=1470575688&qn=14a0d07cda9a77bc&tt=1470575688267.35.532.532" width="200" height="22" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" allowtransparency="true" style="box-sizing: content-box; border-width: 0px; vertical-align: bottom; margin: 0px;"></iframe>
- <iframe id="iframeu1636204_0" src="http://pos.baidu.com/scom?rdid=1636204&dc=2&di=u1636204&dri=0&dis=0&dai=4&ps=995x878&dcb=BAIDU_SSP_define&dtm=HTML_POST&dvi=0.0&dci=-1&dpt=none&tsr=0&tpr=1470575688292&ti=SqlHelper%E5%87%BD%E6%95%B0%E6%9C%89SqlParameter%E5%8F%82%E6%95%B0%EF%BC%8C%E4%BD%86%E4%B8%8D%E9%9C%80%E8%A6%81%E5%8F%82%E6%95%B0%E5%8C%96%E6%9F%A5%E8%AF%A2%E6%97%B6%EF%BC%8C%E6%80%8E%E4%B9%88%E4%BC%A0%E5%8F%82-CSDN%E8%AE%BA%E5%9D%9B-CSDN.NET-%E4%B8%AD&ari=2&dbv=2&drs=3&pcs=1318x625&pss=1318x2952&cfv=18&cpl=28&chi=1&cce=true&cec=UTF-8&tlm=1470575688&rw=625&ltu=http%3A%2F%2Fbbs.csdn.net%2Ftopics%2F391024210&ltr=http%3A%2F%2Fcn.bing.com%2Fsearch%3Fq%3Dsqlhelper%2B%25E5%258F%2582%25E6%2595%25B0%25E5%258C%2596%25E6%259F%25A5%25E8%25AF%25A2&ecd=1&psr=1366x768&par=1366x728&pis=-1x-1&ccd=24&cja=true&cmi=57&col=zh-CN&cdo=-1&tcn=1470575688&qn=df4db34dd0c34156&tt=1470575688267.37.552.552" width="200" height="22" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" allowtransparency="true" style="box-sizing: content-box; border-width: 0px; vertical-align: bottom; margin: 0px;"></iframe>