Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGridView OO approach

Status
Not open for further replies.

Andrzejek

Programmer
Jan 10, 2006
8,530
US

I have thia table in Oracle that looks like this:

[tt]
ID...YEAR_NO...AMOUNT
7....2015......50[blue]
8....2010......15
8....2011......20
8....2013......17
8....2015......36[/blue]
9....2010......15
[/tt]

and for ID of 8 my user wants to see something like this in the datagridview (one row of information, first field - PrevYears - cannot be modified):

[tt]
PrevYears...2012...2013...2014...2015...2016...2017...2018[...]...2032
35.................17............36
[/tt]

I know I can modify my request from Oracle to sum up all Amounts previous to 2012 and get something like:

[tt]
ID...YEAR_NO...AMOUNT
8....2011......35
8....2013......17
8....2015......36
[/tt]

So there are couple of questions:
1. How can I display this data the way my users want in DataGridView?
2. I should allow them to update any value (except PrevYears) in the grid, how do I write it back to the table in Oracle?

I do have it working, but not the Object Oriented (OO) way - I did it all 'by-hand' looping thru the table in my dataset to populate the grid, and then looping thru the data in the grid and Update information in my table per ID. But that's not the way it was intended to do in ADO in VB.NET 2010, and I am sure the pros do that in a lot simpler way (I hope)

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top