比如預存程式是
=========================================
"
ALTER PROCEDURE [dbo].[pr_plantime_showdetil]
(@pojno nvarchar(10)='')
AS
declare @sql nvarchar(800)
BEGIN SET NOCOUNT ON;
if (@pojno<>'')begin set @sql = 'SELECT * from TableA'
print @sql
exec (@sql)
END "
=========================================
如上必需傳入參數@pojno
改寫入SqlDataSource裡時
只要將原上段改寫為
=========================================
"
@sql nvarchar(800)
BEGIN SET NOCOUNT ON;
if (@pojno<>'')begin set @sql = 'SELECT * from TableA'
print @sql
exec (@sql)
END
"
=============================================
並由
SqlDataSource_A.SelectParameters.Add("pojno", pojno);
即可-以上感謝Panda的支持
沒有留言:
張貼留言