DataTable internal index is corrupted: '5'

די אחראים: זייער נייגעריג,אחראי,thefact

אוועטאר
פאטאקי08
שר עשרת אלפים
תגובות: 13865
זיך איינגעשריבן אום: דאנערשטאג אוגוסט 09, 2007 1:30 pm
פארבינד זיך:

DataTable internal index is corrupted: '5'

  • ציטיר
  • צו לייגן א דאנק דארפט איר זיין אריינגעלאגט

תגובה דורך פאטאקי08 »

קאוד: וועל אויס אלע

private void CalcRecipeCost(DataGridView dgv)
        {
            try
            {
 
                int position = this.BindingContext[recipesBindingSource].Position;
                if (position > -1)
                {
 
                    decimal ingCost = 0m;
                    foreach (DataGridViewRow r in dgv.Rows)
                    {
                        ingCost += Convert.ToDecimal(r.Cells[5].Value);
                    }
 
 
 
                    DataRow dr = ((DataRowView)this.recipesBindingSource.Current).Row;
                    decimal laborCost = 0m;
                    if (recipeIDTextBox.Text != "")
                    {
                        laborCost = RecipeDB.GetLaborCost(Convert.ToInt32(recipeIDTextBox.Text));
                        dr["LaborCost"] = laborCost;
                    }
                    dr["IngredientsCost"] = ingCost;
                    decimal totalCost = (ingCost + laborCost);
                    //dr["TotalCost"] = totalCost;
                    decimal costPerUnit = totalCost / Convert.ToDecimal(this.recipeQTTextBox.Text);
                    dr["CostPerUnit"] = costPerUnit;
                    decimal profitMargin = decimal.Parse(this.sellingPricePerUnitTextBox.Text, NumberStyles.Currency) - (costPerUnit / decimal.Parse(this.sellingPricePerUnitTextBox.Text, NumberStyles.Currency));
                    dr["Margin"] = profitMargin;
                }
            }
            catch (FormatException ex)
            {
                //MessageBox.Show(ex.Message);
 
            }
 
        }
 

ביי די ליין

קאוד: וועל אויס אלע

dr["LaborCost"] = laborCost;

באקום איך די ערראר

קאוד: וועל אויס אלע

I get error "DataTable internal index is corrupted: '5'."
אוועטאר
פאטאקי08
שר עשרת אלפים
תגובות: 13865
זיך איינגעשריבן אום: דאנערשטאג אוגוסט 09, 2007 1:30 pm
פארבינד זיך:

  • ציטיר
  • צו לייגן א דאנק דארפט איר זיין אריינגעלאגט

תגובה דורך פאטאקי08 »

קאוד: וועל אויס אלע

private void recipeIngredientsDataGridView_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e)
        {
            //CalcRecipeCost(this.recipeIngredientsDataGridView);
        }


דאס איז געווען די פראבלעם
שרייב תגובה

צוריק צו “דעוועלאופערס ווינקל”