0
我想從存儲過程中加載下拉列表,我沒有任何運氣。我對編碼很陌生,所以我甚至不能給你一個有教養的猜測,即我做錯了什麼。任何援助非常感謝。從存儲過程的負載下拉
Private Sub LoadDropDowns()
Dim drData As SqlDataReader
Dim liItem As ListItem
lblError.Text = ""
lblError2.Text = lblError.Text
Dim aNames As ArrayList
Dim sSQL As String = ""
Try
ddlEmployee.Items.Clear()
liItem = New ListItem
liItem.Value = drData("StaffID")
liItem.Text = drData("Fullname")
ddlEmployee.Items.Add(liItem)
Try
drData = ExecuteSQLReaderProc("dbo.FetchCWSSocialWorkers", "phemployee")
Catch ex As Exception
lblError.Text = ex.Message
End Try
While drData.Read
liItem = New ListItem
liItem.Value = drData("StaffID")
liItem.Text = drData("Fullname")
ddlEmployee.Items.Add(liItem)
End While
ddlEmployee.SelectedIndex = 0
Catch myException As Exception
lblError.Text = myException.Message
Finally
End Try