@@RashiCode it works, thank you, but I still didn't understand why, please elaborate, because may be in some cases we still need to allow user to add rows
Hi Can anyone assist me please, how can I return 0 from that queries? am getting error when on data specific date entry with that PaymentMechanism was not done. How to add zero txtTotalMULTICAIXAAmount.Text = ""; string PaymentMechanism = "CD"; string status = "A"; SqlConnection sqlc = new SqlConnection(ConString); sqlc.Open(); SqlCommand cmd = new SqlCommand("Select SUM(PayInVisaAmount)+SUM(ZeroAmount) from TBL_PAYMENTS where TransactionDate = '" + systemEntryDate.Text + "' and Status = '" + status + "'and SourceID='" + txtUserName.Text + "'and PaymentMechanism = '" + PaymentMechanism + "'", sqlc); decimal i = Convert.ToDecimal(cmd.ExecuteScalar()); sqlc.Close(); totalCash = 0+i; txtTotalMULTICAIXAAmount.Text = i.ToString(); TOTAL_EM_TPA = i; txtTotalMULTICAIXAAmount.Text = string.Format("{0:C}", Convert.ToDouble(txtTotalMULTICAIXAAmount.Text));
Excellent
🖤🖤
Thank You @RashiCode
thank you my bro
🖤
Nice sir
Thanks dear
Thanks man 👍👍👍👍
🖤
thanks
If we can get sum amount of Datagridview with condition? eg: sum of amount that seller'name = john.
yes you can...:)
how to get the sum by date
I get an exception Unhandled saying system.nullreferenceException
go to datagridview properties find
AllowUserToAddRows and trun it false
@@RashiCode it works, thank you, but I still didn't understand why, please elaborate, because may be in some cases we still need to allow user to add rows
Thank you bro same problem here
HOW TO SET 2 DECIMAL AFTER POINT (EX. 500.00 NOT 500.0000)
in database set data type decimal(10,2) this set 2 decimal after point
convert your result to string when you output and use eg x.ToString("n");
Hi Can anyone assist me please, how can I return 0 from that queries?
am getting error when on data specific date entry with that PaymentMechanism was not done.
How to add zero
txtTotalMULTICAIXAAmount.Text = "";
string PaymentMechanism = "CD";
string status = "A";
SqlConnection sqlc = new SqlConnection(ConString);
sqlc.Open();
SqlCommand cmd = new SqlCommand("Select SUM(PayInVisaAmount)+SUM(ZeroAmount) from TBL_PAYMENTS where TransactionDate = '" + systemEntryDate.Text + "' and Status = '" + status + "'and SourceID='" + txtUserName.Text + "'and PaymentMechanism = '" + PaymentMechanism + "'", sqlc);
decimal i = Convert.ToDecimal(cmd.ExecuteScalar());
sqlc.Close();
totalCash = 0+i;
txtTotalMULTICAIXAAmount.Text = i.ToString();
TOTAL_EM_TPA = i;
txtTotalMULTICAIXAAmount.Text = string.Format("{0:C}", Convert.ToDouble(txtTotalMULTICAIXAAmount.Text));