J
James Page
Hi all
A simple problem: I have an aspx page with a details view on it.
The page is designed to collect the users selections and add those
selections to a SQL database.
In the details view there are two drop down lists a text box and a button
which fires the Insert method.
The first DDL is populated via a LINQ datasource on the aspx page.
The second is populated on page load:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Dim db As New MyDatabaseDataContext
Dim dropdown As DropDownList =
CType(DetailsView1.FindControl("ddlProduct"), DropDownList)
dropdown.DataSource = db.StoredProcedure2
dropdown.DataValueField = "productId"
dropdown.DataTextField = "concatName"
dropdown.DataBind()
End Sub
Everything displays and works fine.
However when the record is inserted into the database the selected value
from the second DDL is not being inserted into the database.
Am I missing something fundamental here?
A simple problem: I have an aspx page with a details view on it.
The page is designed to collect the users selections and add those
selections to a SQL database.
In the details view there are two drop down lists a text box and a button
which fires the Insert method.
The first DDL is populated via a LINQ datasource on the aspx page.
The second is populated on page load:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Me.Load
Dim db As New MyDatabaseDataContext
Dim dropdown As DropDownList =
CType(DetailsView1.FindControl("ddlProduct"), DropDownList)
dropdown.DataSource = db.StoredProcedure2
dropdown.DataValueField = "productId"
dropdown.DataTextField = "concatName"
dropdown.DataBind()
End Sub
Everything displays and works fine.
However when the record is inserted into the database the selected value
from the second DDL is not being inserted into the database.
Am I missing something fundamental here?