How to pass parameter value from one sql datasource to another?

Hi everybody,

Here is the problem, how to pass the values from one datasource to another one on the same aspx page, without coding?

 I have a page with FormView control to present data for one selected record from a search page, with edit item and insert item templates created. The main sql datasource keeps control on everything with select, update, delete and insert methods. For insert I am using existing stored procedure, for which the wizard generated all the required parameters. In Command and Parameter Editor I can see them, and I need to define all of them. There is no problem to bind text fields, and dropdown list's selected values using their properties. In this case I don't need to define parameters values in datasource's Command and Parameter Editor.

But I have additional parameters for my insert stored procedure,  and I have them in another sql datasource. I am trying to create a 'hidden' control (label or dropdown list with single value), bound to this datasource, and assign its value to a parameter in Command and Parameter Editor. The problem is that this control is not visible in the available Control ID dropdown list. I tried to move it in several different places on the page: inside or out of insert template, but inside the form view - result is the same. When it is located out of the form view control, it is available in Command and Parameter Editor, but during runtime gives an error: Could not find control 'ddlParams' in ControlParameter 'JT_Dept'.

Any ideas, please?



2/11/2008 9:24:39 PM 72751 articles. 3 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 21

I don't believe you can reference an object that does not exist (ie. is not visible).

You could bind the values to some simple <input type="hidden"....> html controls - then the controls exist, but they are meant to be hidden, so you can't see 'em.

Please click "Mark As Answer" if indeed this is the case.
2/11/2008 10:35:10 PM

 Leave it outside, and reference the control as FormView1$JT_Dept (put your form view's id in there unless it happens to be FormView1)

You will have to go into code view to do that. 

Please Mark As Answer posts that helped you.

"If we learn from our mistakes, I should be brilliant by now."

2/11/2008 10:35:54 PM

FormView1$JT_Dept - that works! Thanks a lot!


2/12/2008 3:19:44 PM

Similar Artilces:

How do i pass an ID value from one datasource to another datasource located inside a repeater control?
Hello,  I am trying to develop a page that allows me to update stages for each item that does not have a status of complete.  I am going to break out what i am trying to do in 4 sections (hopefully to explain this as best as i can), why, what, goal, and problem. Why am i trying to do this? Every day we recieve media in the mail, and we have to put it online.  There are 5 stages we must pass to get this media online, Received, Importing, Compressing, Uploading, and Complete.  I am trying to create a page that will help our media loaders easily keep track of th...

How to pass a value for QueryStringParameter from GridView on one page to SQL datasource on another page
Hi,I am trying to pass a value for the QueryStringParameter EmployeeID from a GridView on one page to a SQL datasource on another. I have set up the GridView's hyperlink field as follows:<asp:HyperLinkFieldText="Contact me"DataTextFormatString="{0}"DataNavigateUrlFields="EmployeeID"DataNavigateUrlFormatString="~/people/contactme.aspx?EmployeeID={0}"Target="_blank"/>and when I run the page and click the hyperlink, it takes me to the correct URL (e.g. when the EmployeeID is 106, http://myserver/mysite/people/contactme.aspx...

Trying to pass values from one control to another control
I have 2 controls on my page. CaseList and Email Reviwer. CaseList contain a datagrid that when the button (5th column) is clicked 2 values should be passed to the email revier control. In the email Reviwer Control I have declared: I have: public void sendCaseIdCatId(int catid,int caseid) { ViewState["EmailReviewerCategoryId"] = catid; ViewState["EmailReviewerCaseid"] = caseid; } in my EmailReviwer control   I tried: //Display the email reviewer panel EmailCaseReviewer.Visible=true; string strcatid = e.Item.Cells[1].Text.ToString(); string strcaseid = e.Item.Cells[0].Text.T...

Passing value from one control to another and inserting that value in a table
Hey all, sorry if the subject is confusing or has already been covered, but I have (obviously) a problem (at least one).This is using:Visual Studio 2005ASP.NET 2.0SQL Server 2005 ExpressVisual Basic I'm building a CRM system for my company and have run into a snag when attempting to add new customer records for a given client. The first thing that any CSR (or admin) must do upon accessing the CRM system is choose which client's customers they are actually working with (we have multiple clients and are ultimately responsible for providing customer service to the clients' end ...

How to pass control values from one ascx user-control to another???
Our site is set up using a primary default aspx page that is used as the "base page" for everything. On this page, we dynmaically place various user controls at run-time. This gives us a functionality similar to using frames where the outer-frame actually just sits there while various webfiles are loaded inside of it. Works great except for one thing... trying to figure out the best way to pass control names/values accross user controls. When the same usercontrol is posting back to itself this is a non issue. So far most of our functionality has worked well using the local...

Pass value from one User Control to another User Control
I have tried to pass value from one user control to another user control. Because of Page Auto Postback, Contrls are load before page is loaded. So I get the value in 2nd UC after one more post back operation. I have visited many suggessions but I cant solve this. Is anyone can help me to solve this. Thank U Muhmmad Fakhrul HossainEmail: mfhossain@gmail.comPhone: +88 01715 111512Web: You'd have to do that through the parent probably in it's Page_Load event handler.   userControl1.publicProperty = userControl2.publicProperty;  ...

Pass 1 control value to another control value
I have this form, is the detailsview, and in edit mode, I have a link that you click to open up a small dhtml window (not a new window but more like a layer so everything is on the same page).  When I select an item from the dhtml window, it puts the value into a textbox.  I then have a button I click and I want to pass that value from that textbox to the textbox in the detailsview.  When I click the button, the value is not passed. Here is the code I use for getting the value from the dhtml window and assigning it to the detailsview textbox: If e.CommandName = "pi...

Value from one datasource as parameter in another
I'm stumped here, and I haven't been able to figure out a way around this problem.  Maybe it's not do-able, but here it is.  I have three object datasources on a page - one that gets the details of the invoice (date, taken by, etc.), one that gets the details of the customer, and one that gets the details of the job.  The same table that stores the invoice's date, etc. holds the customer ID and job ID that the invoice is associated with.  What I'd like to do is use the values CID and JID from the 1st data source as parameters in the second two.  Does anyone know if t...

Passing values from one web control to another.
I'm trying to pass a value from one user control to another. Basically, the first user control selects an id number and then the second user control takes that id number and updates a record in a database. I have the second control set up to accept values using public string idnumber; public string IDnumber { set { idnumber = value; } } The second user control has two buttons that do postbacks, depending on which is clicked, a value is updated in the database identified by this number. The problem I am having is that before I click th...

How do you pass a value from one user control to another?
There must be an example of this somewhere but if there is I can't find it. I have a web form containing 2 user controls. The first displays a list of people. The user selects the person they are interested in and details of that person are to be displayed in the second user control. What is the best way of passing the selected item from the first user control to the second. I can do it with session variables, but there must be a better way than that. thanks You can use properties for that.User Controlprivate string m_Person;public string Person{    get {...

pass value from one user control to another
i have a web page (Page.aspx) that contains a main user control (Main.ascx) which has two other controls within it (A.ascx, B.ascx). I have a text box and a button in A.ascx, when the user clicks the button i want the text in the textbox to be captured and then displayed on B.ascx. I have seen a few discussions on this using RaiseEvent but I'm not sure how to do it. Does anyone have any ideas? check this tutorial in codeproject thanks rasheeda, this post helped me out alot also. ...

To pass values from one user control to another
Hi,       I have a page where there is a user control. inside that user control(let's say Usercontrol1) i have another user control(lets say Usercontrol2). in the usercontrol2 i have a tree and a button. When the page gets loaded first the treeview in the usercontrol2 should not get populated only when i click on a button in the Usercontrol1, then only the treeview in the Usercontrol2 should get populated. also i want to pass the text of a selected treenode when i click on the usercontrol2's button to a textbox in the userc...

Passing parameter from one user control to another
Hi   What would be the best way to pass a parameter from a user control in one part of a master page to another?   I have a mast file: site.master   I have a User Control: Navigation   I have a content page: Category / Product, that uses a user control to display the data.   What I want to be able to do is to change the content of the navigation, depending on what product / category is being displayed.   Do I pass the paremter to the master page and then pass it into the user control, or can I pass it over directly.   i.e.   Set a prop...

Passing Parameter Values From One Application Layer to Another
Hi! Will it be ok to pass parameter values from one layer to another using? For example: In the first layer, I have a function that passes values to the second layer by making a  function call in the second layer. Instead of making the function call like this: CallToSecondLayerFunction(value1, value2, value3) {    FunctionInTheSecondLayer(value1, value2, value3); } Can I do it something like this: StoreParameterValuesInTheDatabase() { someDatabaseId; //Store parameter values in a table. retrieve the database Id then assign to someDatabaseId &nb...

Web resources about - How to pass parameter value from one sql datasource to another? -

Datasource - Wikipedia, the free encyclopedia
A DataSource object has properties that can be modified when necessary. For example, if the data source is moved to a different server, the property ...

Inverness Graham Acquires DataSource
Inverness Graham , a lower middle market private equity firm headquartered in suburban Philadelphia, has acquired DataSource , a print supply ...

SmartGlance for iPad for iPad on the iTunes App Store
Read reviews, get customer ratings, see screenshots, and learn more about SmartGlance for iPad on the App Store. Download SmartGlance for iPad ...

Chaitanya Pandit (@chaitanyapandit) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

Data source - Wikipedia, the free encyclopedia
... Data source A data source is any of the following types of sources for (mostly) digitized data: a database in the Java software platform, datasource ...

2ndQuadrant - PostgreSQL expertise from specialists with a source code level understanding of RDBMS ...
PostgreSQL expertise from specialists with a source code level understanding of RDBMS PostgreSQL Planets Gabriele’s PlanetPostgreSQL Gianni’s ...

Tagged entries for CLOUD COMPUTING
Alan Williamson's output as a Java Champion, Blog-City Architect, BlueDragon Creator, Author, Speaker and Internet Guru

Private equity deals
... of biometric identity management systems, applications and services. Inverness Graham Investment has acquired DataSource ...

C# C Sharp and Tutorials on C#
Learn the c# langauge to build web applications using our online tutorials with live demos. Participate in our forums and learn from others. ...

JavaScript UI Library, Ajax Components & HTML5 Framework - DHTMLX
DHTMLX offers a rich JavaScript library, UI components & HTML5 mobile framework. Build impressive web apps for both desktop and mobile devices. ...

Resources last updated: 12/10/2015 11:12:46 PM