I need some advice about data processing

Answered I need some advice about data processing

  • Tuesday, August 07, 2012 7:05 PM
     
     

    I am developing with VS2008 using framework 3.5.

    I am pulling data from a SQL server 2008 environment (remotely) and loading it into a datagridview.

    Once I've done that, I use Excel automation to create a report in real time.

    I create the sheet  and then copy the results in the datagridview to the sheet using the clipboard.

    So far, so good! All that works fine.

    What I need to be able to do now is go through my results one row at a time so that I can break the data up and format it the way I want to in the Excel sheet.

    How can I iterate through this data after I get it back from the server? Is there a way to go through the datagridview? Should I be looking at working with datatables or something? I've even looked at LINQ but so far have not gotten very far with it.

    Which tree should I be barking up for this? =))



    Todd Cannon Programmer/Analyst SPM Resorts Myrtle Beach, SC

All Replies

  • Tuesday, August 07, 2012 7:21 PM
     
     

    I used to use the vb6 data equilvient datagrid is very good for importing into excel since its setup with columns and rows just like excel. On the other hand, you can databind controls like textboxes to a column in the database by going to data->(databindings)->(advanced) and click on ... beside advanced and choose other data source->project data sources->your connection or tables name here->your field in database.


    Once you eliminate the impossible, whatever remains, no matter how improbable, must be the truth. - "Sherlock holmes" "speak softly and carry a big stick" - theodore roosevelt. Fear leads to anger, anger leads to hate, hate leads to suffering - Yoda. Blog - http://jefferycarlsonblog.blogspot.com/

  • Tuesday, August 07, 2012 8:20 PM
     
     
    What I need to be able to do now is go through my results one row at a time ...

    Todd,

    When you say "go through your results", do you mean in the VB program (i.e., the DataSource.DataTable) or in Excel?

    It's a bit confusing what you're asking for.


    Please call me Frank :)

  • Wednesday, August 08, 2012 12:30 PM
     
     

    Yes, Frank, in the VB program. 

    I think I may have it figured out. I am going to try and loop through the datatable. I'll let you know how it turns out. =))


    Todd Cannon Programmer/Analyst SPM Resorts Myrtle Beach, SC

    • Marked As Answer by ToddCannon Thursday, August 09, 2012 7:24 PM
    • Unmarked As Answer by ToddCannon Thursday, August 09, 2012 7:24 PM
    •  
  • Wednesday, August 08, 2012 4:45 PM
     
     

    Yes, Frank, in the VB program. 

    I think I may have it figured out. I am going to try and loop through the datatable. I'll let you know how it turns out. =))


    Todd Cannon Programmer/Analyst SPM Resorts Myrtle Beach, SC

    That's pronounced "mirta-beach" (I'm originally from Charleston. ;-)

    How are you making out with it?


    Please call me Frank :)

  • Thursday, August 09, 2012 7:24 PM
     
     Answered

    Frank,

    Well I think looping through the datagridview is the way to go for this particular problem. However I will have to wait to test it out because I now have to put this phase of the project on the backburner to work on something else.

    Thanks for the input, as always! =)


    Todd Cannon Programmer/Analyst SPM Resorts Myrtle Beach, SC

    • Marked As Answer by ToddCannon Thursday, August 09, 2012 7:24 PM
    •