Click here to Skip to main content
15,886,110 members
Home / Discussions / C#
   

C#

 
GeneralRe: what to use instead of 'var' in vs 2005 as for the projects developed in vs2005. Pin
N a v a n e e t h20-Jul-09 15:35
N a v a n e e t h20-Jul-09 15:35 
Questionscan using Twain in c#.net Pin
balu1234520-Jul-09 4:09
balu1234520-Jul-09 4:09 
AnswerRe: scan using Twain in c#.net Pin
DaveyM6920-Jul-09 4:17
professionalDaveyM6920-Jul-09 4:17 
AnswerRe: scan using Twain in c#.net Pin
DaveyM6920-Jul-09 4:31
professionalDaveyM6920-Jul-09 4:31 
GeneralRe: scan using Twain in c#.net Pin
Luc Pattyn20-Jul-09 4:50
sitebuilderLuc Pattyn20-Jul-09 4:50 
GeneralRe: scan using Twain in c#.net Pin
DaveyM6920-Jul-09 5:18
professionalDaveyM6920-Jul-09 5:18 
Questionread a excel and show it in datagrid c# Pin
Bird3720-Jul-09 4:07
Bird3720-Jul-09 4:07 
AnswerRe: read a excel and show it in datagrid c# Pin
Adam R Harris20-Jul-09 5:53
Adam R Harris20-Jul-09 5:53 
Well you are on the right track.

What you have to do now is loop through the worksheet and populate a DataTable.
This can be a real pain in the ass if you don't know the "Schema" of the Worksheet.

If you know the last cell and column that data is in you can just loop through it and add new rows to the DataTable. If you don't know the last cell and column, this is where it's a pain in the ass, you have to look for them.

Once you have the data in a DataTable, just set the DataSource of your grid to the DataTable.

You can find a little bit more info on how to properly read excel here[^].

JUST REMEMBER when working with excel you actually have to loop through each open workbook / sheet and close them, pass the parameters for saving, to actually kill excel otherwise it just sits in the background taking up precious resources.

If at first you don't succeed ... post it on The Code Project and Pray.

GeneralRe: read a excel and show it in datagrid c# Pin
Wendelldh21-Jul-09 3:52
Wendelldh21-Jul-09 3:52 
GeneralRe: read a excel and show it in datagrid c# Pin
Adam R Harris21-Jul-09 6:20
Adam R Harris21-Jul-09 6:20 
QuestionLPR failed after 10 jobs Pin
balu1234520-Jul-09 4:06
balu1234520-Jul-09 4:06 
QuestionFramework Version - using 2.0 instead of 3.5 Pin
chrisx5120-Jul-09 3:43
chrisx5120-Jul-09 3:43 
AnswerRe: Framework Version - using 2.0 instead of 3.5 Pin
jo H20-Jul-09 4:52
jo H20-Jul-09 4:52 
GeneralRe: Framework Version - using 2.0 instead of 3.5 Pin
chrisx5120-Jul-09 4:59
chrisx5120-Jul-09 4:59 
GeneralRe: Framework Version - using 2.0 instead of 3.5 Pin
mypicturefaded20-Jul-09 5:03
mypicturefaded20-Jul-09 5:03 
GeneralRe: Framework Version - using 2.0 instead of 3.5 Pin
chrisx5120-Jul-09 5:27
chrisx5120-Jul-09 5:27 
GeneralRe: Framework Version - using 2.0 instead of 3.5 Pin
jo H20-Jul-09 5:33
jo H20-Jul-09 5:33 
GeneralRe: Framework Version - using 2.0 instead of 3.5 Pin
chrisx5120-Jul-09 5:38
chrisx5120-Jul-09 5:38 
GeneralRe: Framework Version - using 2.0 instead of 3.5 Pin
jo H20-Jul-09 6:18
jo H20-Jul-09 6:18 
GeneralRe: Framework Version - using 2.0 instead of 3.5 Pin
chrisx5120-Jul-09 21:39
chrisx5120-Jul-09 21:39 
AnswerRe: Framework Version - using 2.0 instead of 3.5 Pin
Wendelldh21-Jul-09 3:58
Wendelldh21-Jul-09 3:58 
GeneralRe: Framework Version - using 2.0 instead of 3.5 Pin
chrisx5121-Jul-09 4:47
chrisx5121-Jul-09 4:47 
GeneralRe: Framework Version - using 2.0 instead of 3.5 Pin
Wendelldh21-Jul-09 5:09
Wendelldh21-Jul-09 5:09 
Questionexecute powershell script on remote machine Pin
arkiboys20-Jul-09 3:38
arkiboys20-Jul-09 3:38 
QuestionWindows Form does not show if created in other thread Pin
gehbitte20-Jul-09 3:33
gehbitte20-Jul-09 3:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.