Last post Apr 07, 2015 08:22 PM by Lannie
Apr 06, 2015 11:53 PM|slen|LINK
string strSQL = "SELECT * FROM [" + excelSheets + "]";
OleDbCommand cmd = new OleDbCommand(strSQL, conn);
DataTable datatable = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
DataTable filteredRows = datatable.Rows.Cast<DataRow>()
.Where(row => !(row.ItemArray.All(field => field is System.DBNull || field.ToString() == "")))
I found out that there are column name like F15, F16, F17. F18 ......and so on.
How am I going to remove the columns or to filter out the columns like above
Apr 07, 2015 08:22 PM|Lannie|LINK
If there are columns with any white space, as is possible with Excel free text entry and not seen by the eye,
OLDBD will attempt to load those cells.
restrict query to specific columns by name like select DATE_ORDER, CAR_COLOR, TRIM_PACKAGE FROM your excel sheet.
you can also restrict query to a specific range