As our application is going to deploy in Azure Environment as PAAS…hence we can not install any driver . Looking for any substitute which can able to load data set in grid with out using OLEDB Driver .My Application is 4.8 dot net framework based app.
Existing Code
///
/// Return dataset representing attached excel file
///
///
///
public DataSet FillDataSet(DataSet ds,int rows_to_ignore)
{
int max_empty_allowed = 2;
if (ds == null)
ds = new DataSet();
DataSet _tmpds = new DataSet();
this._dc = new System.Data.OleDb.OleDbConnection(this.Connection);
this._dcomm = new System.Data.OleDb.OleDbCommand();
this._dcomm.Connection = this._dc;
this._dcomm.CommandText = this.CommandText;
this._adapter = new System.Data.OleDb.OleDbDataAdapter(this._dcomm);
try
{
this._adapter.Fill(ds);
if (ds.Tables.Count == 0)
return ds;
if (rows_to_ignore > 0)
{
while(rows_to_ignore > 0)
{
ds.Tables[0].Rows[0].Delete();
rows_to_ignore--;
}
ds.Tables[0].AcceptChanges();
}
_tmpds = ds.Clone();
///Ignore empty rows
int empty_row = 0;
foreach(DataRow _dr in ds.Tables[0].Rows)
{
int emptyCount = 0;
foreach(DataColumn _dc in ds.Tables[0].Columns)
{
if (_dr[_dc] == DBNull.Value)
emptyCount++;
}
if (emptyCount != ds.Tables[0].Columns.Count)
_tmpds.Tables[0].ImportRow(_dr);
else
{
empty_row++;
/// Reached empty allowed count ignore rest of excel sheet
if (empty_row >= max_empty_allowed)
break;
}
}
this._dc.Dispose();
return _tmpds;[text]
}
catch(System.Data.OleDb.OleDbException oex)
{
throw oex;
}
}
Looking for any substitute which can work in PAAS