ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   how can i query an sheet with a where clause....from c# code using (https://www.excelbanter.com/charts-charting-excel/58099-how-can-i-query-sheet-where-clause-c-code-using.html)

GAC.Me.Up.baby

how can i query an sheet with a where clause....from c# code using
 
hello ,

i'm triing to retreive buch of row but i want to apply a Where clause, so i
get row = a certain date..... but my Query retreive only 1 row always(the
first one)...but several should match... i even set the col format to string
and still get only 1 row and got no syntax error.. ex:
THE SQL PARM LOOKS LIKE :
"SELECT F12 AS [Strategy], F5 AS [Quantite], F7 AS [Devise], F2 AS
[Portefeuille], F4 AS [Ticker], F1 AS [Date], F3 AS [TradeType], F9 AS
[Status], F10 AS [Courtier], F8 AS [Commision], F11 AS [Commentaire], F6 AS
[Prix] FROM [2002$] WHERE F1 ='11/28/2005' "

Method call:

public DataTable Select(string sql)
{
OleDbDataAdapter da = new OleDbDataAdapter(sql, _connection);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}

Anything wrong with the where clause..??? i even put the col format has
string and copy the exact string im looking for in the col ...but the query
still returning only 1 row (the first one).... and should be way more.


All times are GMT +1. The time now is 02:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com