日期:2014-05-17  浏览次数:20391 次

sqldatasource问题
vs2005+web

  <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:cgcConnectionString %>"
  SelectCommand="SELECT * FROM [cljbxx_cldwdy_dwxx] WHERE [id] IN (@allclid)">
  <SelectParameters>
  <asp:SessionParameter Name="allclid" SessionField="allclid" Type="String" />
  </SelectParameters>
  </asp:SqlDataSource>

[id]为int类型,为Session("allclid")赋值"1,2",会报错“将vchar转换为int出错”

各位老大该怎么做?

------解决方案--------------------
探讨

引用:

int里有“,”吗? Session("")一般用来传字符串和字符串数组把
"44749,44750"与"'44749','44750'"是同样的结果。