hello, I am new to vb.net and following TUTORIAL By Scott Mitchell and Matthew Rouse, but I cant get it right. could some please give me a hand? thank you<BR><BR>I need to update datagrid using dropdownlist, but everytime I click the update button after chosing from dropdownlist.. it always return the initial value.<BR><BR>tempvalue = CType(E.Item.FindControl("ddlBooking"), DropDownList).SelectedItem.Value &#060;--- this always the same as the initial value no matter how I choose the dropdownlist<BR><BR><BR>Here is my web code:<BR>&#060;asp:DropDownList id=ddlBooking runat="server" Width="109px" DataValueField="booking_hold_n" DataTextField="booking_name" DataSource="&#060;%# me.GetBooking() %&#062;" SelectedIndex=&#039;&#060;%# me.GetSelIndex(Container.DataItem("booking.booking _hold_n")) %&#062;&#039;&#062;&#060;/asp:DropDownList&#062;<BR><BR>here is my vb code:<BR><BR> Public Sub DataEdit(ByVal Sender As Object, ByVal E As DataGridCommandEventArgs)<BR> grdApplicants.EditItemIndex = E.Item.ItemIndex<BR> bindgrdApplicants()<BR><BR> End Sub<BR><BR> Public Function GetBooking() As DataSet<BR> &#039;Public Function GetBooking()<BR> Dim service As New SMSService()<BR> Dim connection As OleDbConnection = service.DbConnection(Request)<BR> &#039;connection.Open()<BR> Dim adapter As OleDbDataAdapter<BR> Dim DS As New DataSet()<BR><BR> Try<BR><BR> &#039;Dim sql As String = "SELECT * FROM booking WHERE booking.booking_hold_n = applicant_booking_hold_n "<BR> Dim sql As String = "SELECT * FROM booking"<BR> adapter = New OleDbDataAdapter(sql, connection)<BR> &#039;adapter.SelectCommand.CommandType = CommandType.StoredProcedure<BR><BR> adapter.SelectCommand.Parameters.Add(New OleDbParameter("booking_hold_n", OleDbType.VarChar, 100))<BR> &#039;adapter.SelectCommand.Parameters("booking_ho ld_n").Value = applicant_booking_hold_n<BR><BR> adapter.Fill(ddldataset, "bookingList") &#039;filldataset")<BR><BR> <BR> Return ddldataset<BR><BR> Catch objE As Exception<BR> &#039; Dim service As New SMSService()<BR> service.writeErrorPage(objE, Response)<BR> Finally<BR> connection.Close()<BR> End Try<BR> End Function<BR><BR><BR> Public Function GetSelIndex(ByVal CatID As String) As Integer<BR> Dim iLoop As Integer<BR><BR> &#039;Loop through each row in the DataSet<BR> Dim dt As DataTable = ddldataset.Tables("bookingList")<BR> For iLoop = 0 To dt.Rows.Count - 1<BR> If Int32.Parse(CatID) = _<BR> Int32.Parse(dt.Rows(iLoop)("booking_hold_n")) Then<BR> Return iLoop<BR> End If<BR> Next iLoop<BR> End Function<BR><BR> Public Sub dataupdate(ByVal sender As Object, ByVal E As DataGridCommandEventArgs)<BR> Dim service As New SMSService()<BR> Dim command As New OleDb.OleDbCommand()<BR> command.Connection = service.DbConnection(Request)<BR> Dim TempList As DropDownList<BR> Dim tempvalue As String<BR> Dim tempvalue2 As String<BR> Dim TempapplicantId As Label<BR> Dim tempapplicantidvalue As String<BR><BR> Try<BR> TempList = E.Item.FindControl("ddlBooking")<BR> &#039;tempvalue = TempList.SelectedItem.Value<BR> tempvalue = CType(E.Item.FindControl("ddlBooking"), DropDownList).SelectedItem.Value<BR> TempapplicantId = E.Item.FindControl("lblLoanId")<BR> tempapplicantidvalue = TempapplicantId.Text<BR><BR> command.Connection.Open()<BR> command.Transaction = command.Connection.BeginTransaction<BR><BR> command.CommandText = "UPDATE Applicants SET " & _<BR> "Applicants.booking_hold_n =" & tempvalue & _<BR> " WHERE Applicants.loan_id =" & tempapplicantidvalue<BR><BR> command.ExecuteNonQuery()<BR><BR> command.Transaction.Commit()<BR><BR><BR> grdApplicants.EditItemIndex = -1<BR> bindgrdApplicants()<BR> Catch objE As Exception<BR> service.writeErrorPage(objE, Response)<BR> Finally<BR> command.Connection.Close()<BR> End Try<BR><BR> End Sub<BR>