database - Displaying data in the Data Grid View? Access, C# -


I want to calculate the total value and display it in the data grid view. The fourth column does not retrieve information from the database, so I do not know how to do this. Here looks like a GUI:

Enter image details here < P> Even I still have the code ...

  double colonel = 0; // Set column total 0 foreach (DataRow currentRow in itemDS.Tables [0] .owsows) {// Add data grid view avowadgrid view Rows.Add (currentRow [1]. Ostring (), currentro [2]. Ostroong (), currentro [3] .restring ()); // Item item and Quant = Convert.ToDouble (currentRow [1]) variable item for quantal and value; var priceEach = convert Repeat (Current Rau [3]); // Multiply the amount of items by the quantity of the item, double sub-total = item Quant * priceEach; // Do this for each line Total + = Sub Total; } // Display subtotal subTotalOutput.Text = colTotal.ToString (); // Calculate the double tax of tax = colonial * .073; // Perform total tax tax. Text = convert Toasting (tax); // Add subtotal and total tax double totalpres = colotle + tax; // total value total total performance Text = convert toTrice (totPrice); }    

I believe sub-thule before you populate the grid Calculate, and add the sub-total variable at the end of your call like: turn on the dataCob [0]. Items in TRS [0] .ro.) {// Declarable Variables item item for price and price = convert = convert. Tud Double (current Rau [1]); Var priceEach = Convert Repeat (Current Rau [3]); // Multiply the amount of items by the quantity of the item, double sub-total = item Quant * priceEach; // data grid view invoice data grid view. Rao Add (current Rao [1]. Ostring (), currentro [2]. Ostring (), onro [3]. Ostring (sub-total); // Do this for each line Total + = Sub Total; }

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -