1. 程式人生 > >使用sqlhelper類查詢時假如不需要引數化,那到時SqlParameter這個傳參怎麼處理

使用sqlhelper類查詢時假如不需要引數化,那到時SqlParameter這個傳參怎麼處理

我在學寫SqlHelper類。用SqlParameter【】陣列做為引數。
我按條件查詢時,可以弄個引數化


但是查詢時假如並不需要引數化,那到時SqlParameter這個傳參怎麼處理
比如
查詢語句是 “select*from Student”,並不需要寫@id這種命令引數了。 
但我定義的函式 ExecuteDataTable()需要傳參SQLParameter型別,怎麼處理啊?
  • <iframe id="iframeu1636200_0" src="http://pos.baidu.com/scom?rdid=1636200&amp;dc=2&amp;di=u1636200&amp;dri=0&amp;dis=0&amp;dai=2&amp;ps=995x370&amp;dcb=BAIDU_SSP_define&amp;dtm=HTML_POST&amp;dvi=0.0&amp;dci=-1&amp;dpt=none&amp;tsr=0&amp;tpr=1470575688292&amp;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&amp;ari=2&amp;dbv=2&amp;drs=3&amp;pcs=1318x625&amp;pss=1318x2952&amp;cfv=18&amp;cpl=28&amp;chi=1&amp;cce=true&amp;cec=UTF-8&amp;tlm=1470575688&amp;rw=625&amp;ltu=http%3A%2F%2Fbbs.csdn.net%2Ftopics%2F391024210&amp;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&amp;ecd=1&amp;psr=1366x768&amp;par=1366x728&amp;pis=-1x-1&amp;ccd=24&amp;cja=true&amp;cmi=57&amp;col=zh-CN&amp;cdo=-1&amp;tcn=1470575688&amp;qn=e8af64dab90e24c8&amp;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&amp;dc=2&amp;di=u1636201&amp;dri=0&amp;dis=0&amp;dai=3&amp;ps=995x624&amp;dcb=BAIDU_SSP_define&amp;dtm=HTML_POST&amp;dvi=0.0&amp;dci=-1&amp;dpt=none&amp;tsr=0&amp;tpr=1470575688292&amp;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&amp;ari=2&amp;dbv=2&amp;drs=3&amp;pcs=1318x625&amp;pss=1318x2952&amp;cfv=18&amp;cpl=28&amp;chi=1&amp;cce=true&amp;cec=UTF-8&amp;tlm=1470575688&amp;rw=625&amp;ltu=http%3A%2F%2Fbbs.csdn.net%2Ftopics%2F391024210&amp;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&amp;ecd=1&amp;psr=1366x768&amp;par=1366x728&amp;pis=-1x-1&amp;ccd=24&amp;cja=true&amp;cmi=57&amp;col=zh-CN&amp;cdo=-1&amp;tcn=1470575688&amp;qn=14a0d07cda9a77bc&amp;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&amp;dc=2&amp;di=u1636204&amp;dri=0&amp;dis=0&amp;dai=4&amp;ps=995x878&amp;dcb=BAIDU_SSP_define&amp;dtm=HTML_POST&amp;dvi=0.0&amp;dci=-1&amp;dpt=none&amp;tsr=0&amp;tpr=1470575688292&amp;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&amp;ari=2&amp;dbv=2&amp;drs=3&amp;pcs=1318x625&amp;pss=1318x2952&amp;cfv=18&amp;cpl=28&amp;chi=1&amp;cce=true&amp;cec=UTF-8&amp;tlm=1470575688&amp;rw=625&amp;ltu=http%3A%2F%2Fbbs.csdn.net%2Ftopics%2F391024210&amp;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&amp;ecd=1&amp;psr=1366x768&amp;par=1366x728&amp;pis=-1x-1&amp;ccd=24&amp;cja=true&amp;cmi=57&amp;col=zh-CN&amp;cdo=-1&amp;tcn=1470575688&amp;qn=df4db34dd0c34156&amp;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>