[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

UpdateParameter not being passed

Asked by Bill732 in Programming for ASP.NET, C# Programming Language

Tags: asp.net, C#

Hello,

I have a details veiw used to update a data through a strongly typed dataset.

At the _ItemUpdating event I remove some parameters so I can add them back in with the selected values from dropdownlists. Then the program continues to the updating method with the new values. Except for just one value, Main_Number in the code below.

The only difference between this parameter and the others is that it will be used in the method as a string while the others will be used as number types (decimal and integer as shown below). If anything thing I would expect the number types to fail but they work just fine.

I'm trying to figure out why just one (Main_Number) is not properly passed to the method like the others. What happens is the original value is passed instead of the changed value.

Thanks very much,
-Bill
 
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
//code that changes the parameter values:
  {
        //Find dropdown to get selected Item text  
        DropDownList ddlDvCountry = (DropDownList)
        dvParent.FindControl("ddlCountry");
        string strCountry = ddlDvCountry.SelectedItem.Value;
 
        DropDownList ddlDvState = (DropDownList)
        dvParent.FindControl("ddlState");
        string strState = ddlDvState.SelectedItem.Value;
 
        DropDownList ddlIndustry = (DropDownList)
        dvParent.FindControl("ddlIndustry");
        string strIndustry = ddlIndustry.SelectedItem.Value;
 
        DropDownList ddlMainName = (DropDownList)
        dvParent.FindControl("ddlMainName");
        string strMain = ddlMainName.SelectedItem.Value;
 
        odsParentDetail.UpdateParameters.Remove(odsParentDetail.UpdateParameters["countryID"]);
        odsParentDetail.UpdateParameters.Remove(odsParentDetail.UpdateParameters["stateID"]);
        odsParentDetail.UpdateParameters.Remove(odsParentDetail.UpdateParameters["industryID"]);
        odsParentDetail.UpdateParameters.Remove(odsParentDetail.UpdateParameters["Main_Number"]);
        odsParentDetail.UpdateParameters.Add("countryID", strCountry);
        odsParentDetail.UpdateParameters.Add("stateID", strState);
        odsParentDetail.UpdateParameters.Add("industryID", strIndustry);
        odsParentDetail.UpdateParameters.Add("Main_Number", strMain);
        
   //At this point in debug I can see that all paramters are changed - including Main_Number.
 
}
 
//Beginning of the method that uses the parameters. In debug at the point below I can see that all of the values from above are passed correctly to the method except for Main_Number - which is unchanged.   
 
public bool UpdateParentDetail(int Parent_Number, string Parent_Name, int industryID, decimal countryID, decimal stateID, string Main_Number)
     {
         //do stuff
}
[+][-]09/21/09 06:51 AM, ID: 25382808Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: Programming for ASP.NET, C# Programming Language
Tags: asp.net, C#
Sign Up Now!
Solution Provided By: Bill732
Participating Experts: 1
Solution Grade: A
 
[+][-]09/16/09 03:21 PM, ID: 25350863Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/18/09 01:25 PM, ID: 25369677Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09/21/09 06:10 AM, ID: 25382457Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/21/09 06:20 AM, ID: 25382523Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/21/09 06:46 AM, ID: 25382754Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09/21/09 06:56 AM, ID: 25382841Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625