ddlWorkArea.DataSource = ds
Private Sub ListView1_ItemEditing(sender As Object, e As System.Web.UI.WebControls.ListViewEditEventArgs) Handles ListView1.ItemEditing Dim i As Integer = e.NewEditIndex Dim strWorkArea As String Dim lstWorkArea As ListItem Dim txtWorkArea As Label = ListView1.Items(i).FindControl("WorkAreaLabel") Dim ddlWorkArea As DropDownList = ListView1.Items(i).FindControl("WorkAreaDDL") Dim Site As String Site = Me.TextBoxAuditSite.Text Dim strConn As String = ConfigurationManager.ConnectionStrings("MyConnectionString").ConnectionString Dim objConn As New SqlConnection(strConn) Dim ds As New DataSet() Dim myda As New SqlDataAdapter("SELECT [WorkArea] FROM [zEdits]", objConn) myda.Fill(ds, "workArea") ddlWorkArea.DataSource = ds ddlWorkArea.DataValueField = "WorkArea" ddlWorkArea.DataBind() If txtWorkArea IsNot Nothing Then strWorkArea = txtWorkArea.Text lstWorkArea = ddlWorkArea.Items.FindByText(strWorkArea) If IsNothing(lstWorkArea) Then ddlWorkArea.Items.Insert(0, "") Else ddlWorkArea.Items.Insert(0, "") ddlWorkArea.SelectedValue = strWorkArea End If End If End Sub
myda.Fill(ds, "workArea")
myda.Fill(ds, "zEdits")
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)