Author: ragha.raikar | Posted on: 7/31/2009 4:26:19 AM | Views : 521



Hi,
    I am importing data from excel to db but while importing the order of data is getting changed
to alphabetical order.Can anyone give me solution to import excel data to db in the same order as present in excel.
I used below code to retrive data from excel

DataSet ds = new DataSet();
DataTable dt = oleDbExcelCon.GetOleDbSchemaTable(OleDbSchemaGuid.Tables_Info, null);
tablename = new string[dt.Rows.Count];
OleDbDataAdapter da;
da = new OleDbDataAdapter("select distinct * from [" + strSheetName + "$]", oleDbExcelCon);               
da.Fill(ds);
return ds.Tables[0];




...

Go to the complete details ...