Won't update dataset with new dropdownlist values

  • Thread starter Thread starter Geoff
  • Start date Start date
G

Geoff

I have a Webform with 2 dropdownlists and 2 text fields for the date. No
matter what I select in the drop downlist, when I hit the submit button the
data always comes up with the original values that were in the dropdownlists
however the date parameters are accepted. The dropdownlist also go back to
their original values instead of maintaining the values selected. My submit
code is as follows:
SqlDataAdapter1.SelectCommand.Parameters("@varSD").Value =
DateTime.Parse(fld_SD.Text)

SqlDataAdapter1.SelectCommand.Parameters("@varED").Value =
DateTime.Parse(fld_ED.Text)

SqlDataAdapter1.SelectCommand.Parameters("@varSN").Value =
Int32.Parse(lst_Store.SelectedValue)

SqlDataAdapter1.SelectCommand.Parameters("@varRN").Value =
Int32.Parse(lst_Report.SelectedValue)

SqlDataAdapter1.SelectCommand.Parameters("@varUno").Value =
Request.Cookies("ckusername").Value

SqlDataAdapter1.Fill(Ds_crdata2)

UltraWebGrid1.DataBind()
 
How easy. I was populating the DDLs in the page load event. I just added:
"If Not (IsPostBack) Then" at the beginning of the page load event.
Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top