I want to be able for a user to click on a button and then it runs a function and then shows the results in the data list.
i know i can get data and bind it through my tables
Sub BindCommsDataList(ByVal dlComms As DataList, ByVal sAddrno As String, ByVal sNameNo As String)
Dim mySelectQuery As String = "SELECT * FROM table"
Dim myConnection As New MySqlConnection(Session("localConn"))
Dim myCommand As New MySqlCommand(mySelectQuery, myConnection)
myConnection.Open()
Dim myDataAdapter = New MySqlDataAdapter(myCommand)
Dim myDataSet As New DataSet
myDataAdapter.Fill(myDataSet, "comms")
dlComms.DataSource = myDataSet
dlComms.DataKeyField = "seq"
dlComms.DataBind()
myConnection.Close()
End Sub
But how do i run a function which binds data manually
EDIT:
The data revived back will be in text format. So ideally i just want to do..
RtnDealerName.Text = xoGetWebPage.RtnDealerName
but it says i dont have access to RtnDealerName
I don’t think there’s any way to add items directly to the DataList control, but you can use the results to build a datasource control, like a DataTable for example:
Here’s some simple markup for the DataList control: