I need some advice about data processing
-
martes, 07 de agosto de 2012 19:05
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
Todas las respuestas
-
martes, 07 de agosto de 2012 19:21
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/
-
martes, 07 de agosto de 2012 20:20
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 :)
-
miércoles, 08 de agosto de 2012 12:30
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
- Marcado como respuesta ToddCannon jueves, 09 de agosto de 2012 19:24
- Desmarcado como respuesta ToddCannon jueves, 09 de agosto de 2012 19:24
-
miércoles, 08 de agosto de 2012 16:45
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 :)
-
jueves, 09 de agosto de 2012 19:24
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
- Marcado como respuesta ToddCannon jueves, 09 de agosto de 2012 19:24

