参数化查询时where in 语句怎么写

__SDSFileSearch是一个SQLDataSource控件<br><br>__SDSFileSearch.SelectCommand = "SELECT * FROM [Catalog] WHERE [CatalogID] IN (@CatalogIDs)";<br>Parameter parm =&nbsp; new Parameter("CatalogIDs", TypeCode.Int32, "1,2");<br>__SDSFileSearch.SelectParameters.Add(parm);<br>上面那么写不行,应该怎么写呢?

子衿沉夜
浏览 614回答 2
2回答

largeQ

将Parameter parm = new Parameter("CatalogIDs", TypeCode.Int32, "1,2"); 改为 Parameter parm = new Parameter("CatalogIDs", TypeCode.String, "1,2"); 试试
打开App,查看更多内容
随时随地看视频慕课网APP