0
我有一個存儲過程AutoDeliveryReportsByUser
,它根據其參數@Logins
返回結果。我試圖在radcombobox中填充db列Emails
的所有結果。我能夠抓住列的最後一個值並將其放在一個標籤中(這是不好的),但沒有能夠在組合框中獲取任何東西。從VB/sql服務器填充組合框
Protected Sub ReportEmailList()
'sUser = Mid(HttpContext.Current.User.Identity.Name, InStr(HttpContext.Current.User.Identity.Name, "\", CompareMethod.Text) + 1)
sUser = "athens1"
Dim cmd As New SqlCommand("AutoDeliverReportsByUser", GetUDBSQLConn)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.Add("@Logins", SqlDbType.VarChar)
cmd.Parameters("@Logins").Value = sUser
cmd.Connection.Open()
Dim r As SqlDataReader = cmd.ExecuteReader
While r.Read
LblEmailList.Text = r("Emails")
RadCBEmailList.DataTextField = r("Emails")
End While
cmd.Connection.Close()
cmd.Dispose()
End Sub