0

有点困惑,想知道这是 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
4

0 回答 0