Home > DeveloperSection > Forums > C # update And Delete
Sagar Ambre
Sagar Ambre

Total Post:3

Points:21
Posted on    February-25-2016 2:29 AM

 C# Winforms 
Ratings:


 4 Reply(s)
 405  View(s)
Rate this:
Hi,
Sir I want to know about Update and Delete sql table in c#.net with windows application..
  When i save my data in database in sale form like following fields.....0)date ,1)custid , 2)custnm ,3)itemid ,4)itemnm ,5)itemqty ,6)itemrate ,7)totalRs...
                                                                  i saved following data suppose :
    A]   i have 20 biscuit packs in my stock table.
    B]Date :24/02/2016 , custid :1 , custnm : Sagar , itemid : 101 , itemnm : biscuit ,  itemqty : 10 , itemrate : 5 , totalRs : 50.
    C]so my account balance is 50. bcoz it is my income..so in my Balance Table i have 50 rs.
    D]and my stock is  biscuit = 10 packs .
    E]now customer came and he replace the 5 biscuit pack .
    F]So i want to do like this on sales return form....
date : 25/02/2016 , custid : 1 , custnm : Sagar , itemid : 101 , itemnm : biscuit ,  itemqty : 5 , itemrate : 5 , totalRs : 25.
when i done this entry i want to update my stock and balance table like this ...
              |  1] Start Stock = 20 ;                                | 1]start balance = 0 ;
Stock  | 2]After Sale = 10 ;                     Balance| 2]After Sale = 50 ;
             |  3]After Sale Return = 15;                       | 3]After Sale Return = 25


                  So Please help me how to do it in my programs bcoz i m doing inventory software if i delete the transaction then
My balance want to = 0 ; and Stock Want to = 20  So please Help Me



Anupam Mishra

Total Post:135

Points:949
Posted on    February-26-2016 4:32 AM

Hi Sagar,
I have considered your problem and i want to give a simple approach to better confine  to handle this problem, if you will creating a separate table for each entity like SALES, PURCHASE_RETURN , SALES_RETURN, and STOCK and  Finally we create a view for  Balance
Here, below are  STOCK table i.e initially item in the inventory 
:

Here below our SALE table data:



Now next table is PURCHASE_RETURN


Here, we are  returning 5 biscuit packets. So below is SALES_RETURN:


Now we are creating  a database view for Checking current status of Balance:



and finally a closure look of the Balance View: 



So, you don't worry about deletion and updation in inventory. your output is according to your current status. I think this is a final output matches as your requirement that is mentioned in your problem.





Modified On Feb-26-2016 04:35:51 AM

Sagar Ambre
Sagar Ambre

Total Post:3

Points:21
Posted on    February-26-2016 4:53 AM

Thank you Very much sir ,
 but i kindly request you can you show me with Example and coding in c#.net with sql server database
step by step, because i really need it please sir
please help me in step by step other wise suggest site or video to me ...please
once again thanks for help me...
                                                                Regards Sagar

Anupam Mishra

Total Post:135

Points:949
Posted on    February-26-2016 6:17 AM

 Their are many  online solution are available, i personally suggest you to download sample project on inventory and try to build according your requirement with the help of  sample . For SQL Server this video is useful, Link is below:
    

Modified On Feb-26-2016 06:18:27 AM

Sagar Ambre
Sagar Ambre

Total Post:3

Points:21
Posted on    February-28-2016 2:50 AM

Hi ,
    Now anyone tell me the use of trigger in C#.net  for this query with example and snapshot..please..please

I want to know about Update and Delete sql table in c#.net with windows application..
  When i save my data in database in sale form like following fields.....0)date ,1)custid , 2)custnm ,3)itemid ,4)itemnm ,5)itemqty ,6)itemrate ,7)totalRs...
                                                                  i saved following data suppose :
    A]   i have 20 biscuit packs in my stock table.
    B]Date :24/02/2016 , custid :1 , custnm : Sagar , itemid : 101 , itemnm : biscuit ,  itemqty : 10 , itemrate : 5 , totalRs : 50.
    C]so my account balance is 50. bcoz it is my income..so in my Balance Table i have 50 rs.
    D]and my stock is  biscuit = 10 packs .
    E]now customer came and he replace the 5 biscuit pack .
    F]So i want to do like this on sales return form....
date : 25/02/2016 , custid : 1 , custnm : Sagar , itemid : 101 , itemnm : biscuit ,  itemqty : 5 , itemrate : 5 , totalRs : 25.
when i done this entry i want to update my stock and balance table like this ...
              |  1] Start Stock = 20 ;                                | 1]start balance = 0 ;
Stock  | 2]After Sale = 10 ;                     Balance| 2]After Sale = 50 ;
             |  3]After Sale Return = 15;                       | 3]After Sale Return = 25


                  So Please help me how to do it in my programs bcoz i m doing inventory software if i delete the transaction then
My balance want to = 0 ; and Stock Want to = 20  So please Help Me

Don't want to miss updates? Please click the below button!

Follow MindStick