473,625 Members | 2,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

directcast, findcontrol, parameter collection help

i tried explaining this yesterday...her e'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 EditItemTemplat e has OrderID displayed from
Orders table.
I want to pass this data (insert), after changing info in textboxes within
datalist editItemTemplat e, 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.Integ er, 4))
HERE I should have the variable value for ItemId... but because my txtItemId
(textbox) is in
the EditItemTemplat e ( <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").Valu e = 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
EditItemTemplat e
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 1414

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 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. ...
2
5704
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 my page. It appears that I am unable to use avariable as the parameter for the method as I get the followingerror message: "Object reference not set to an instance of an object" CODE: Panel pnl = (Panel) FindControl(testvariable);...
1
7759
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 regularly. Has anyone seen this before? It's pretty aggravating to have to iterate through the controls in each grid cell to find the ones I need, especially since finding those cells is not always easy. Here's my ItemDataBound() handler: private void...
6
10825
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 found this in the VB Language reference: <quote> The DirectCast keyword introduces a type conversion operation. You use it the same way you use the CType keyword.... Both keywords take an expression to be converted as the first argument, and
15
1353
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 GIVE ME AN ERROR DIRECTCAST IS NOT VALID
5
2606
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 j.add("string") directcast(j,collections.arraylist).add("string2")
2
3475
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 control... Let's say the control I want to find is "myControl". So I call e.theObject.FindControl("myControl"); It always returns null and I know the name of the control is good (that's the ID I gave it, is it possible it has changed because it's...
0
3679
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 : parameter 1 - From Collection Date parameter 2 - To Collection Date I should display the results base on this selection criteria : 1) specific date - to enter specific date in FROM and TO field eg 20071227 to 20071227 2) greater or equal date -...
4
2977
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 = Page.Master.FindControl("CenterPanelContent $ItemBuilderWizard $StepNavigationTemplateContainerID $StepNavFinalStepButton") as Panel;
9
2182
by: AAaron123 | last post by:
I'm this far in determining the correct code to find a textbox I need to set. Me.Master.FindControl("Body1").FindControl("Form2").FindControl("Table2").FindControl("TableRow7").FindControl("TableCellR7C2S2").FindControl("RightCPH").FindControl("div1").FindControl("div2").FindControl("LoginView1") Took me longer than I want to say to produce the above and I'm not there yet.
0
8251
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8182
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8352
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8494
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7178
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5570
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4085
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2614
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 we have to send another system

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.