0

I get the error message

The format of the input string is incorrect.

 public partial class Fiche_Ordre : DevExpress.XtraEditors.XtraForm
    {
        public string ClientID = "", OderId = "", TempId = "";
       .....

        public Fiche_Ordre()
        {
            InitializeComponent();

            Constuct_Page();

        }

        public Fiche_Ordre(string OrderID)
        {
            InitializeComponent();
            Constuct_Page();

            Pers_Ordre oPersOrdr = oOrder_BL.Get_OrdreOne_BL(ClientID, Convert.ToInt32(OderId), false);
            textEdit_RaisonSoc.Text = oPersOrdr.RaisonSoc;
        }

when I call the constuctor from other form:

 private void GoToFiche(object sender, EventArgs e)
        {
            try
            {                              
                Fiche_Ordre f_Fiche = new Fiche_Ordre("1");
               // Fiche_Ordre f_Fiche = new Fiche_Ordre(gridView_Liste_Ordres.GetRowCellValue(0, "NO_ORDRE").ToString());
                f_Fiche.Show();
            }
            catch (Exception excThrown)
            {
                MessageBox.Show(excThrown.Message);          
            }

I have constructor: public Fiche_Ordre(string OrderID)

2
  • 2
    What line are you getting the error on? I suspect it is not on any of the bits of code you posted. Commented Apr 26, 2012 at 19:28
  • 2
    Because OderId is set to "". You're not using the right variable. Commented Apr 26, 2012 at 19:28

1 Answer 1

2
 public Fiche_Ordre(string OrderID)
        {
            InitializeComponent();
            Constuct_Page();

            Pers_Ordre oPersOrdr = oOrder_BL.Get_OrdreOne_BL(ClientID, Convert.ToInt32(OderId), false);
            textEdit_RaisonSoc.Text = oPersOrdr.RaisonSoc;
        }

You are passing OrderID and using OderId.

Watch your case and spelling.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.