M
Mike Irwin
I'm trying to do a simple date-based SELECT using an Excel spreadsheet as
the data source. The spreadsheet contains a named range called
'showsRange', cell A1 in the spreadsheet is named 'Date' and the dates in
the column below it are entered as MM/DD/YYYY. What I want to do is to
select only the rows where the date is >= today's date. The spreadsheet is
bound to a DataGrid if that matters.
I'd appreciate any help with this as I'm a newbie to ADO.NET and C#. I
searched through the MSDN Library and Google but couldn't come up with any
information that could get me started in the right direction.
Here's a bit of what I have so far:
OleDbCommand objCmdSelect = new OleDbCommand("SELECT * FROM showsRange",
objConn);
OleDbDataAdapter objAdapter1 = new OleDbDataAdapter();
objAdapter1.SelectCommand = objCmdSelect;
DataSet objDataset1 = new DataSet();
objAdapter1.Fill(objDataset1, "XLData");
showsGrid.DataSource = objDataset1.Tables[0].DefaultView;
showsGrid.DataBind();
the data source. The spreadsheet contains a named range called
'showsRange', cell A1 in the spreadsheet is named 'Date' and the dates in
the column below it are entered as MM/DD/YYYY. What I want to do is to
select only the rows where the date is >= today's date. The spreadsheet is
bound to a DataGrid if that matters.
I'd appreciate any help with this as I'm a newbie to ADO.NET and C#. I
searched through the MSDN Library and Google but couldn't come up with any
information that could get me started in the right direction.
Here's a bit of what I have so far:
OleDbCommand objCmdSelect = new OleDbCommand("SELECT * FROM showsRange",
objConn);
OleDbDataAdapter objAdapter1 = new OleDbDataAdapter();
objAdapter1.SelectCommand = objCmdSelect;
DataSet objDataset1 = new DataSet();
objAdapter1.Fill(objDataset1, "XLData");
showsGrid.DataSource = objDataset1.Tables[0].DefaultView;
showsGrid.DataBind();