2011-09-26 56 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 }; 
        }; 
       }; 
     } 

这个想法是在选择事件中设置参数。

相关问题