Hi Im learning C# lately. Im working right now on a project that should help me learn some new stuff about C# programming... I'm programming a simple accounting software, that can be used by small businesses, especially by small shops. This software should register products, it will have a form to sell them and pay bills, a form to use for furnishing, and will also make reports and such stuff... I made the register form, but now I'm having some problems with furnishing form. For example, when the store owner buy some products (furnish his store with products) I want to register them on furnishing form, but he will be able to register these products only if they're registered first in the Registering Form...

Here is a picture that might help u to understand my question better..


The DataGrid that ur seeing is connected with Furnishing table, and will show records from that table...

I want that the user to enter a barcode in the textbox, and the quantity for that product and then when he click add, the Registering Table (the table where products are registered) will be checked, if there is a Barcode Match, the product details from the register table will be taken and will be insterted to specifik columns on Furnishing table, the quantity that is entered on textbox will be insterted at the Quantity column on the Furnishing table... and the columns Date will be the actual date...

I just have no idea how to do this right now...

Hope ill get some help...

or maybe u just can tell me what to use to accomplish this, should I do this using LINQs, or ADO.net, if someone can refer me a book or tutorials it will be really cool...

thnx a lot

9 Years
Discussion Span
Last Post by Ramy Mahrous


For your particular application I think you need 2 tables. One for products and another for stock. Usually the customer can enter new products - barcode/description/productcode/ etc in the products table.
I presume this your "Registering" table.

In the other table the stock quantities could be placed upon ordering/selling/breakages etc.
I presume this your "Furnishing" table. ?

The way I would recommend is using a singe interface for the products table - to allow additions/updates/deletions.

When the customer needs to add a new product handle the keypress event on the barcode entry textbox, validate it and search the the database for a similar barcode. If its found just display it, otherwise proceed to add a new product.

BTW. I wouldn't use the wizard to create the data access layer because it hides all the "good bits" which you will need to know in order to write robust software.

Also I would not base the software on a product barcode but use a generated unique id for each product.



thnx a lot for ur reply...
I have already created a product table where the user can edit, update or add the new products...

I dont need the Furnishing table for quantity but I need it to keep track when the user bought products for his store... so this way I can create reports about " How much products did he buy for his store, how much did he sell, etc...

so I dont think that if I use a single table ( only the products table) i can do this...

all I need to know is how to take a cell from a row in Products table, and put it to Furnishing table .. is there anyway to do it..

For example, using LINQ or a Query i find the row I need using select * from tblProducts where barcode = (textbox or a variable where the entered barcode is stored)..

so when i have this row i want to insert Column3 from tblProducts, in column4 in tblFurnishing, and of course the other details...

if no one can tell me how to do this then a book or some tutorials that would help me would be welcome.. thnx a lot


Because it's big thread I didn't read all, but you can tell us what the specific problem you face, like I've problem that my data not updated and show us your code with little explanation and using Code Tags.

But, It's very hard to solve a bulk of problems + helping in logic and database design.


well, I have 2 tables, the Product table and Furnishing table...

All I need to know is How can I take a cell from Product table, the cell will be taken from a row that will be chosen using "where", and I want to bind that cell to furnishing table...

Just need some tips how to dow it...

thnx a lot

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.