Question duplicate 1 rows in datagridview

martinus

New member
Joined
Apr 11, 2018
Messages
3
Programming Experience
Beginner
Hi there to all,




I'm a newbie at programming and still learning so please be gentle :)


Using C# visual studio 2017 , sql database


So i have this massive database from which i collect data. The data i collect with a sql and finally display on a form with a datagridview.
The data which is displayed could be data containing serial nrs or batch nrs.


So i select some data from 3 different tables with some joins, the selection is made on base of a project nr.


When the data contains a column with serial nrs.... There is no problem. But when it contains a column with batch nrs i have a problem.


The problem:
In the database there is data with for instance 5 times the same batchnr. The data i collect from it tells me this ( one field is a number field which tells me how many batch nr there should be).
So in the datagrid view i see 1 row with many column. What i need in this case is 5 rows.


What are the options to solve this:
Can i copy and paste the row 4 times in the datagridview
or should i work with my temp table before i fill the datagridview.


I hope that someone can point me in the right direction
 
Good morning,

Thanks for your respons. What do you need to know about the schema. Table data, or SQL ? type of fields?


It maybe not the most crasefull solution.... but i have in my final results 1 row with data, is it posible to duplicate this 1 row mutiple times
so i have a datagridview with 5 or 10 times the same row?

Thanks in advanced for responses

Martinus
 
Hi to all,

I figured it out how to solve :)

First i clone my datatable structure in a new datatable. Then i check the value of the amount (number of rows with products it should be)in my original table.
Then a loop will import the amount of times is needed in the new table.

The new table i then use for the datagridview.

Thread can be closed

Martinus
 
Back
Top Bottom