Hi
I need urgent help regarding the following.
I have a master detail relationship form. I need to give my client facility to modify / delete the row from the details table. I am able to display the rows in data gird view of the detail part. I can show the row in the respective textbox and combo box to update the required things. But when i try to update the things i am getting confused about how to update the stock from the stock table of the perticular item. My confusion is when should i update the stock table and stock. At the place where i update the whole purchase bill. I need some code for that. I am using ADODB for connection. Please help me this is very urgent.
Million Thanks in advance.
Loading

sourav mondal 0Posted Dec 18, 2013, 9:49 AM
http://dotnetawesome.blogspot.com/2013/12/display-master-detail-data-from-database-using-gridview-and-listview.html
Video Tutorial : https://www.youtube.com/watch?v=dW2iF-sEpSI
Neha SharmaPosted Sep 23, 2013, 3:58 AM
check you INBOX here...
Kedar PawgiPosted Sep 23, 2013, 3:54 AM
Neha SharmaPosted Sep 23, 2013, 3:39 AM
your question is to update the whole table before binding in datagrid or without click on edit button ??
Kedar PawgiPosted Sep 23, 2013, 3:30 AM
I am giving the gridview section for you. If you need any thing for that let me know.
Thank you.
Neha SharmaPosted Sep 23, 2013, 3:12 AM
can you show me grid section ??
you want to update the griddata before loading??do you want to update data on the button click (view detail) and then show in the datagrid ??
what data you want to update do you want to update the data after purchase ?
you are explaining much but please put only important description . no need to describe all describe only the prob part .
Kedar PawgiPosted Sep 23, 2013, 3:03 AM
In this form there u can see the master detail form, i enter unique invoice no and hit View Det. After that i retrive all the details (master :--- GL Name, Camp , Branch, date , book invoice no) using the same invoiceno i retrive details part and show in the grid. Master things can be updated easily but for details i hit Edit button on the grid and all the details come up in the above prodtype, name,qty rate, freebag, i makes changes then hit button written "New" (it name changes to Update on View Det click ). After that i update the current row of the data grid. Now my question is before showing into the data grid shall i update the new stock which got changed or below that Amount there are two more buttons for updating whole Invoice where Whole invoice will be updated and Cancel for canceling the updation. So when should i update the stock and whole bill. while updating to grid i calculate the new stock.
Thanks in Advance.
Hope the things are clear now. If there is another way out to this plz let me know.
Neha SharmaPosted Sep 23, 2013, 2:41 AM
Can you please tell me why you want to update the stock table and can you show me the screen shot of your table or datagridview ??
Kedar PawgiPosted Sep 23, 2013, 2:29 AM
Actually the issue is i am able to update the master and detail table easily but issue is coming for updating the stock table which just contain the itemid, itemname and currentStock fields. Actually i was thinking of situation say if i first update stock table and if any problem arise and comp shuts down or hangs then just stock will get updated and proper master and details will not be updated.
So please guide on this situation, or give a solution about when and how i should update the stock and tables.
Thanks in advance.
The table structure is as below.
--
-- Table structure for table `deliverymemodet`
--
CREATE TABLE IF NOT EXISTS `deliverymemodet` (
`deliveryMemoId` int(5) NOT NULL,
`prodName` varchar(50) NOT NULL,
`productType` varchar(50) NOT NULL,
`prodQty` int(5) NOT NULL,
`prodRate` double(15,2) NOT NULL,
`amount` double(15,2) NOT NULL,
`freeBagType` varchar(50) NOT NULL,
`freeBags` int(4) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `deliverymemomast`
--
CREATE TABLE IF NOT EXISTS `deliverymemomast` (
`invoiceNo` int(5) NOT NULL AUTO_INCREMENT,
`bookDMNo` int(5) NOT NULL,
`compname` varchar(5) NOT NULL DEFAULT 'AF',
`fyyear` varchar(10) NOT NULL DEFAULT '13-14',
`groupLeaderName` varchar(50) NOT NULL,
`groupLeaderCode` varchar(7) NOT NULL,
`camp` varchar(50) NOT NULL,
`branch` varchar(50) NOT NULL,
`district` varchar(50) NOT NULL,
`todaysdt` date NOT NULL,
`dispatchedBy` varchar(50) NOT NULL,
`vehicleNo` varchar(50) NOT NULL,
`amountInWords` varchar(300) NOT NULL,
`totalAmount` double(15,2) NOT NULL,
PRIMARY KEY (`invoiceNo`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=12 ;
venkata kumarPosted Sep 23, 2013, 1:46 AM