数据行中的文本框在下拉列表后不会填充

时间:2013-09-19 14:19:55

标签: vb.net datarow

有点疑惑,想知道它是ASP.Net问题还是我的代码。当运行'For Each datarow'时,如果我在文本框之前放下任何下拉列表,那么后面的任何文本框都是空白的,即使它在'red blodded'时它所遇到的代码也是空白的。 (官方词?)

代码示例:

    Dim sConnString As String = System.Web.Configuration.WebConfigurationManager.ConnectionStrings("SQLLInk").ConnectionString
    Dim dsNames As SqlDataSource
    dsNames = New SqlDataSource
    dsNames.ConnectionString = sConnString
    Dim sSQL As String
    Dim vID As String
    vID = (sender.SelectedValue.ToString)
    sSQL = "SELECT * FROM tblExpenses WHERE ID = '" & Session.Item("ID").ToString & "'"
    dsNames.SelectCommand = sSQL

    For Each datarow As Data.DataRowView In dsNames.Select(DataSourceSelectArguments.Empty)

        lblEmployeeID.Text = datarow("EmployeeID").ToString
        lblReceiptFile.Text = datarow("ReceiptFile").ToString
        txtAdminNotes.Text = datarow("AdminNotes").ToString
        '##########################################
        'if I put ddProgress before any of the above they appear blank 
        ddProgress.Text = datarow("Progress").ToString
    Next

0 个答案:

没有答案