Getting exception inside datagridview looping.

Sep 27 2010 4:27 AM

Hi all expert,

I have two fields in data grid one comboxbox type another is texbox type. As per user selection I want to add multiple record at a time in backend.  Here is my looping code…pls somebody help………help…help………me..inside looping code I am getting casting exceptions.

Unable to cast object of type 'System.String' to type 'Create_Sales_Back_Order.DynamicsGPService.SalesBackorderLine[]'.

  for (int counter = 0; counter < (CreateSalesBackOrderGrid.Rows.Count); counter++)

       {

                                salesBackorder.Lines = (SalesBackorderLine[])CreateSalesBackOrderGrid.Rows[counter].Cells[0].Value;    //here getting this exception.

//here I should write insert method.

                }

 


Answers (7)