yes thank you very much I was not checking the declaration of TotalAmount and assuming that Reseting or setting all controls to null will work But What I did is in the Create Sale button after Calling the SaveSale() function I again declare the TotalAmount=0; So whenever sale is created it will...
//Declared a variable
protected double TotalAmount = 0;
//inside AddtoCard button click event after clicking this button medicine add to the Data Grid View and show the total in Lbl_Total and Txt_TotalAmount
TotalAmount += Double.Parse(Txt_TotalPrice.Text);
Lbl_Total.Text = "Rs. " +...
I have created a function named ClearAllAfterSale() in which I Clear DataGridView, Textboxes and reset Labels as shown below:
private void ClearAllAfterSale()
{
DGV_Med.Rows.Clear();
Lbl_Total.ResetText();
Lbl_Total.ResetText()...
Yes I checked by changing the Query of ListBox to Select Med_ID instead of Med_Name where it shows the Different ID it means ListBox have saved Items correctly.
The Issue is with the Controls that Even I select Digas with ID 1 or Digas with ID 12 both are showing same details in the controls as...
Hello to everyone,
Please Read Carefully and Answer afterwards.
Here I have an issue with C# WinForms ListBox, ListBox not showing the Same name Medicine with different details.
The Products are added to the database successfully. In which I have two medicines with the same name but are with...
Well after a lots and lots of tries according to what suggested here nothing worked and I researched and then tried this way to achieve what I wanted and explained above posting here for the reference for other. As Resolved
Used RowPrePaint Event to achieve the desired result
private void...
Ok, I turned it back to SQL Query but again am I going to get the solution or you will again felt like on drugs that I again set it back to Sql Query just to get you out of that on drugs feeling, So you can see #2, #3 and #4 in right order. Now if I can get a solution.
Yes Sir as I mentioned my code is what I tried is a must to show my effort what I did I know its wrong but shown otherwise if I didn't then the answer be like I haven't bother to try myself or even bother to show what I did, that's why shown my part.
But besides I also explained what I wanted...
Sir what else to explain the Question explains a lot what I want to do is to change the row color of a DataGridView on the basis of query in the code already mentioned the query and what I am missing, ok if something I am doing wrong in the code please correct thats what my question is how to...
What I tried is: (But need to know what to put in if condition and what to put in foreach condition)
ViewMedicine_DataGrid is a name of DataGridView
Pharmacist_Medicine is a name of a Table in Sql Server
E_Date is a column name of Expiry Date
private void...
ok Thank you Sir, I simply used Convert.DateTime to convert AddMedicine.Parameters.AddWithValue("Expry_Date", Convert.ToDateTime(Txt_AddMedicine_ExpiryDate.Text)); and its now working thanks for helping
Yes, I am using DateTimePicker not a textbox. And I updated my database and store procedure with DateTime Data type for Expiry and Manufacturing Date and tried added a medicine this time which is not adding a medicine and giving an exception error that is: Error Converting Datatype nvarchar to...
Dates are not just numbers Dates includes Char and Strings as well Like Comma Day name and Month Name, If I will not use varchar and use Date as a variable then how to parse date while passing a parameter of store procedure here:
AddMedicine.Parameters.AddWithValue("Expry_Date"...
I have a Chart on Dashboard where I want when the dashboard load the Chart displays the data according to database.
Below is a Table I created named Medic
Create table Medic(
Med_ID int Primary Key Identity (1,1),
Med_Name varchar(250) not null,
M_Date varchar(250) not null...
Just to see if the Error lies here or not, I removed the Picture Box from the design and the whole of that part of code including the part you emphasized: but the error is with something else
var msUp = new MemoryStream(Login_Form.Upic);
var bytes = msUp.ToArray()...
After Changing the line in UC_Profile.cs from var msUp = Login_Form.Upic; to var msUp = new MemoryStream(Login_Form.Upic); and start the program and close, and this time on Administrator_Panel.cs show this Error Buffer Cannot be null. Parameter name: buffer
Buffer cannot be null. Parameter...
Hello, Please Help in this regard as I was very happy complete one phase of my work there was no error and everything worked just fine so I saved and closed the all the open instances of forms and user controls to start working on a new window form and went to have a little rest after a while...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.