473,499 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

directcast, findcontrol, parameter collection help

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

Nov 22 '05 #1
0 1402

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
325
by: rodneybauer1 | last post by:
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...
2
5683
by: Mark D'Souza via .NET 247 | last post by:
In trying to create a Panel object with the FindControl methodusing a string variable as the paramater. The code is below. The variable 'testvariable' is equal to pnl_0 which is anexisting Panel on...
1
7741
by: James G. Beldock | last post by:
I have seen the following behavior: when issuing a Page.FindControl() for a control which exists in an item template (from within an ItemDataBound() event, for example), I get nulls back...
6
10810
by: Ot | last post by:
I apparently have a bit to learn about Casting and Conversion. I have been thinking of them as the same but a discussion in another thread leads me to believe that this is wrong thinking. I...
15
1325
by: Bernard Bourée | last post by:
Hello I have the following code: Public Groupes As New Hashtable Dim Entry As DictionaryEntry For Each Entry In Groupes Dim Gr As Groupe = DirectCast(Entry.Value, Groupe) ===> THIS LINE...
5
2594
by: Matt | last post by:
Does anyone know or care to find out the speed difference between a directcast call and a direct call? for instance, i might have these lines of code: dim j as collections.arraylist ...
2
3470
by: ThunderMusic | last post by:
Hi, I have a custom WebControl. I fire an event and send, as the EventArg, another WebControl that contains sub controls (ParseChildren(true))... It can contain anything, but I want to find one...
0
3672
by: jans78 | last post by:
Appreciate if you all can help me to solve my Crystal Report problems First, I create some parameters and one of the parameters is Date. I set the parameter for the date is String. For example :...
4
2967
by: Hillbilly | last post by:
Maybe this is or isn't some kind of bug but it sure is goofy and remains a mystery that really has me puzzled for two reasons... // goofy syntax functions as expected... Panel finalStepButton =...
9
2174
by: AAaron123 | last post by:
I'm this far in determining the correct code to find a textbox I need to set. ...
0
7128
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7006
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7385
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4917
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4597
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1425
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
661
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.