How to calculate Tax,Qty, total amount in c#Jyoti Jodha9yAsked Apr 3, 2017, 5:55 AM1.8kVisual Basic .NETHow to calculate Tax,Qty, total amount in window application c#
Ramesh Palanivel9y agoPosted Apr 3, 2017, 6:32 AMAccepted answerHI Jyothi, My suggestion is , Create a product table which has columns, Product_Id,Product_Name,ProductShot_Name,TotalQty,prize ,Tax %.. Insert value for that tables like 1,Mazza,Mazza, 50,48,2 Select the "Mazza" in combobox and enter the no of qty in that. Once enter these values automatically it want to be calculate , try the below code, int productid=combobox1.selectedvalue(); int ProductPrize; deimal Tax; con.open(); slqcommand cmd=new sqlcommand("select Prize,tax from where prodcutid='"+productid+"'",con); sqldatareader sdr=cmd.executereader(); while(sdr.hasrows) { ProductPrize=convert.toint32(getstring(0)); Tax=convert.toDecimal(getstring(1)); } con.close(); ProductPrize.Text=convert.toint32(convert.toint32(qty.Text)*ProdcutPrize) Tax.Text=convert.toDecimal(((ProductPrize)*(tax))/100);
Ramesh PalanivelPosted Apr 3, 2017, 6:32 AM
Karthi KeyanPosted Apr 3, 2017, 6:20 AM