How to pass a variable to the SelectCommand of a SqlDataSource?

后端 未结 10 650
耶瑟儿~
耶瑟儿~ 2020-12-01 00:37

I want to pass variable from the code behind to the SelectCommand of a SqlDataSource?

I don\'t want to use built-in parameter types (like ControlParameter, QueryStri

10条回答
  •  一整个雨季
    2020-12-01 01:06

    Just add a custom property to the page which will return the variable of your choice. You can then use the built-in "control" parameter type.

    In the code behind, add:

    Dim MyVariable as Long
    
    
    ReadOnly Property MyCustomProperty As Long
        Get
            Return MyVariable
        End Get
    End Property
    

    In the select parameters section add:

    
    

提交回复
热议问题