Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8100109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:39:25+00:00 2026-06-05T22:39:25+00:00

I face the following exception when i try to use parametrized query with informix

  • 0

I face the following exception when i try to use parametrized query with informix .

A character to numeric conversion process failed

                    StringBuilder sQuery = new StringBuilder();
                    Dictionary<string, string> paramList = new Dictionary<string, string>();
                    cmdTxt.Append(" UPDATE userwidgetto SET widget_color = ?, widget_column = ?, widget_order = ?,widget_state = ?,widget_type = ? ");
                    cmdTxt.Append(" WHERE process_id = ? AND emp_num = ? ");

                    paramList.Add("process_id", Process_id.ToString());
                    paramList.Add("emp_num", Emp_num.ToString());
                    paramList.Add("widget_color", Widget_color.TrimEnd());
                    paramList.Add("widget_column", Widget_column.ToString().TrimEnd());
                    paramList.Add("widget_order", Widget_order.ToString());
                    paramList.Add("widget_state", Widget_state.ToString());
                    paramList.Add("widget_type", Widget_type.ToString());
                    affectedRow = DAL_Helper.Execute_NonQuery(cmdTxt.ToString(), CommandType.Text, paramList);

public int Execute_NonQuery(string cmdText, CommandType cmdType, Dictionary<string, string> Param_arr)
            {
                Open_Connection();
                int return_val = -1;
                command.CommandText = cmdText;
                command.CommandType = cmdType;
                command.Transaction = current_trans;
                command.Parameters.Clear();
                if (Param_arr != null)
                {
                    foreach (KeyValuePair<string, string> parameter in Param_arr)
                    {
                        param = command.CreateParameter();
                        param.ParameterName = parameter.Key.ToString();
                        if (parameter.Value.ToString() == "Null" || string.IsNullOrEmpty(parameter.Value))
                            param.Value = DBNull.Value;
                        else
                            param.Value = parameter.Value.ToString();
                        command.Parameters.Add(param);
                    }
                }
                try
                {
                    return_val = command.ExecuteNonQuery();//means no error message //OK                
                }
                catch (IfxException ifxEx)// Handle IBM.data.informix : mostly catched
                {
                    return_val = ifxEx.Errors[0].NativeError;
                }
                catch (Exception Ex)
                {
                    ErrMapping.WriteLog("\r\n" + Ex.Message);
                    return_val = ExCodeConst;
                }
                finally
                {
                    Close_Connection();
                }
                return return_val;
            }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T22:39:26+00:00Added an answer on June 5, 2026 at 10:39 pm

    I suppose you are using an OleDb client.
    In that case, the parameters should be inserted in the same exact position order of you command string placeholders (?)

    cmdTxt.Append(" UPDATE userwidgetto SET widget_color = ?, widget_column = ?, widget_order = ?,widget_state = ?,widget_type = ? ");
    cmdTxt.Append(" WHERE process_id = ? AND emp_num = ? ");
    paramList.Add("widget_color", Widget_color.TrimEnd());
    paramList.Add("widget_column", Widget_column.ToString().TrimEnd());
    paramList.Add("widget_order", Widget_order.ToString());
    paramList.Add("widget_state", Widget_state.ToString());
    paramList.Add("widget_type", Widget_type.ToString()); 
    paramList.Add("process_id", Process_id.ToString());
    paramList.Add("emp_num", Emp_num.ToString());
    affectedRow = DAL_Helper.Execute_NonQuery(cmdTxt.ToString(), CommandType.Text, paramList); 
    

    Also the Dictionary<string, string> paramList forces every value passed to the DAL_Helper to be of string type.
    And, I think, this is not the case from the parameters names given (process_id is not a string in the database table right?).
    As someone as already suggested in a comment, you should change the paramList to be a Dictionary<string, object> and then add the parameters with a string conversion only where is appropriate (meaning, the datatype of the table column is a string type).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I face the following exception: weblogic.transaction.internal.TimedOutException: Transaction timed out after 300 seconds this is
I face the following problem function book($memberid, $classid){ if (!book){ // update the db
I face following problem with three20 photobrowser app : 1: Some time images are
The following is a scenario I commonly face: You have a set of commits
I have the following @font-face code provided to me by webfonts.fonts.com . @font-face {
I'm having trouble using the following @font-face declaration to work with my Rails 3.1
I face a problem in scipy 'leastsq' optimisation routine, if i execute the following
I am using an embedded typeface using the following code: @font-face {font-family: 'PFDinTextPro-Regular';src: url('../webfonts/15B214_0.eot');src:
I am trying to do face detection on android, and I am following the
I face the following strange problem while using JFileChooser package sandbox; import java.io.File; import

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.