2011-09-26 54 views
1

即時通訊使用C#下的視覺工作室2010ObjectDataSource SelectParameter是一個對象嗎?

我有一個對象的數據源,做執行特定功能服用2個參數的第一個爲int,在列表中的第二

如何傳遞整數的這個列表來對象數據源!????

List<int> a = new List<int>(); 
a=Some Function that populates the list of int by int values; 
ObjectDataSource1.SelectParameter["Sources"].DefaultValue=a; 

?? ? ?

回答

3
public WebForm1() 
     { 
      this.Init += (o, e) => 
       { 
        myDS.Selecting += (ds, dsArgs) => 
        { 
         dsArgs.InputParameters["filter"] = new List<int> { 1, 2, 3 }; 
        }; 
       }; 
     } 

這個想法是在選擇事件中設置參數。

相關問題