Go step wise. Start from showing excel data in gridview, like:
public DataSet GetDataSetForGrid()
{
string cnstr = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=C:\\MyExcelSheet.xls;" + "Extended Properties=Excel 9.0";
OleDbConnection oledbConn = new OleDbConnection(cnstr);
string strSQL = "SELECT * FROM [Sheet1$]";
OleDbCommand cmd = new OleDbCommand(strSQL, oledbConn);
DataSet ds = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
da.Fill(ds);
return ds;
}
An article discussing same:
Import Data from Excel to DataGridView in C#[
^]
Try out!