i tried explaining this yesterday...here's a better formed question. thanks
using Northwind sql database, and an oledb connection to it
a datalist is bound to the productID and ProductName of the Product table
also, a dropdownlist in the EditItemTemplate has OrderID displayed from
Orders table.
I want to pass this data (insert), after changing info in textboxes within
datalist editItemTemplate, as necessary, to the Order Details table.
I think what I have to do is get the parameters correct for the sql insert
statement to work:\
for example
INSERT INTO OrderDetails (OrderId, ItemPrice, Discount) VALUES (@OrderId,
@OrderPrice, @Discount) WHERE @ItemId=?
I have something like this:
cmd.Parameters.Add(New OleDbParameter("@ItemId, OleDbType.Integer, 4))
HERE I should have the variable value for ItemId... but because my txtItemId
(textbox) is in
the EditItemTemplate ( <asp:Textbox ...>) I cant seem to get it with
findcontrol directcast or \
by naming it explicitly.
please help
what i have below that cmd.parameter statement is currently
cmd.Parameters("@ItemId").Value = ItemId.ToString() which is no good.
It should be something like = txtItemId.Value
so, what i'm trying to do is fill a datalist with a dataset, get into the
EditItemTemplate
and make changes to the textboxes is necessary and then instead of updating
the bound
dataset to insert the values of the textboxes into a different data table.
Is there a way to do this??
thanks