Hey Guys I'm a newbie programmer and looking to see if someone can help me out with a lil program I'm developing.I want to track orders for my small furniture factory.

I want to create a tracking number based on the OrderNumber+ProductID+SeriesNumber.It should look like this:

The SeriesNumber is for if a product is ordered more than once then it should add 1 to the SeriesNumber.So know it should look like this:

That is were my problem is!How do I search my Datagrid before I add the product to check for a duplicate and if so how do I add 1 to the SeriesNumber?

Hope this isn't too complicated to do!!thanx!!

Are these data which are shown in DGV binded from some data source, like dataTable?

Are these data which are shown in DGV binded from some data source, like dataTable?

I dont understand?:$....the data will be added to the DGV thru "Button1" and will produce the tracking number when i click it.Its when im registering the order.So I guess its not binded.hopes this helps.

Why don't you rather do it this way.
Use the series as an ID for tracking products then have another column(maybe named 'Number_of_Times_Ordered') and for each time the product is ordered or purchased, the value in the column is incremented by one. This would help prevent unforeseen issues. Like for instance, you want to make a search on a particular product, you must have to know the number of times the product has been ordered before you can get the exact ID(string) you want to search for and this would in turn result to a manual process and a total system failure in achieving the purpose for which it was built. So in my own opinion, just use the series as ID's to track products then have a counter for each purchase of a product.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.