0
Answer

C#Net 2008 Error message Error 3 Cannot implicitly convert type 'int' to 'string'

Ask a question
Lennie Kuah

Lennie Kuah

14y
2.2k
1

 Hi Friends,
I am very puzzled by the error message : Error 3 Cannot implicitly convert type 'int' to 'string'
the data in this variable intPOrderIS obtained from a Calling FORM FrmSalesView passing it to FORM FrmSalesMaint using this coding:
 private int intPOrderID; // Property variable
   public Int32  PropOrderId     <----- RECEIVING FORM FrmSalesMaint
            {
                get {return intPOrderID;}
                set { intPOrderID = value; }
            } 

------------------------------------------------------------------------
Under this event 
private void FrmSalesMaint_Load(object sender,
EventArgs e)
This is the coding that generate the error message

this.txtOrderID.Text = intPOrderID;  <---- cause of error
--------------------------------------------
Although I have use CAST to convert intPOrderID to string it still generates error message. This is what I have tried.
this.txtOrderID.Text = (string)  intPOrderID;  <---- cause of error
PLEASE HELP ME, I AM VERY DESPERATE TO UNDERSTAND.