Import from Excel to datagrid using c#.-- URGENT.
Posted on 2008-06-13
I have a datagrid with about 10 columns in it.Now i want to import the values in excel file to datagrid.
1-----There are only 5 columns in excel.So i want to match the column names for excel and datagrid for populating the same column values in datagrid.
2-----I have a session value session["RiskID"]. I want to check this value against all the values in first column"RiskId" in excel. If any one value in the column dosen't match, then it shud not import to datagrid.Instead it shud prompt a message to user.
3-----I have a column called "SI" in excel. I want to check all the values in this column. If any one value in the column has "0", then it shud not import to datagrid.Instead it shud prompt a message to user.
4-----If any values in excel has values like " Microsoft's " with an apostaphe, it shud not be a problem in importing the values to datagrid.
Please help me on this. Thanks. Its very Urgent