Search results for query: *

  1. Omer Butt

    Resolved Label is showing Total result by adding total to previous total instead new total

    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...
  2. Omer Butt

    Resolved Label is showing Total result by adding total to previous total instead new total

    //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. " +...
  3. Omer Butt

    Resolved Label is showing Total result by adding total to previous total instead new total

    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()...
  4. Omer Butt

    ListBox is not showing the product with same name with different price

    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...
  5. Omer Butt

    ListBox is not showing the product with same name with different price

    private void ListBoxMedicines_SelectedIndexChanged(object sender, EventArgs e) { Txt_NoOfUnits.Clear(); string Name = ListBoxMedicines.GetItemText(ListBoxMedicines.SelectedItem); Txt_MedicineName.Text = Name; string Query = "select Med_ID...
  6. Omer Butt

    ListBox is not showing the product with same name with different price

    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...
  7. Omer Butt

    Resolved How to Change the row color of DataGridView based on SQL Query?

    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...
  8. Omer Butt

    Resolved How to Change the row color of DataGridView based on SQL Query?

    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.
  9. Omer Butt

    Resolved How to Change the row color of DataGridView based on SQL Query?

    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...
  10. Omer Butt

    Resolved How to Change the row color of DataGridView based on SQL Query?

    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...
  11. Omer Butt

    Resolved How to Change the row color of DataGridView based on SQL Query?

    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...
  12. Omer Butt

    Resolved conversion failed when converting date string from database

    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
  13. Omer Butt

    Resolved conversion failed when converting date string from database

    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...
  14. Omer Butt

    Resolved conversion failed when converting date string from database

    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"...
  15. Omer Butt

    Resolved conversion failed when converting date string from database

    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...
  16. Omer Butt

    Question Value cannot be null. Parameter name: source

    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()...
  17. Omer Butt

    Question Value cannot be null. Parameter name: source

    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...
  18. Omer Butt

    Question Value cannot be null. Parameter name: source

    Ok I am editing the Question itself and with picture I will mention the code inside the picture
  19. Omer Butt

    Question Value cannot be null. Parameter name: source

    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...
  20. Omer Butt

    Resolved Is it possible to retain auto increment even after deleting a tuple from a datagridview

    What if it matter only for visual representation ?
Back
Top Bottom