The Code that I have written compiles with zero errors but does not updates the FileCode column values. Please suggest the best way of manipulating records in excel file.
What is missing from my code?
/// <summary>
/// Read from Excel Sheet
/// </summary>
private void UsingDataSet()
{
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\Sales.xls;Extended Properties=Excel 8.0");
con.Open();
OleDbDataAdapter objAdapter = new OleDbDataAdapter("SELECT * FROM [Sheet1$]", con);
DataSet objDataSet = new DataSet();
string strFileName;
int intCntr=0;
objAdapter.Fill(objDataSet, "MyTableName");
foreach (DataRow pRow in objDataSet.Tables["MyTableName"].Rows)
{
strFileName = pRow["FileName"].ToString();
Bookmarks