G
Guest
I dont know where I am going wrong but the OleDB dataadapter returns data
when it is a simple select statement like "Select * from Customers".
but when i try to do a simple search query like "SELECT * FROM Customers
WHERE LastName LIKE '*something*'", it does not return anything, even though
the same query returns records in the data base. Currently I am using MS
Access as the DB. The code for the function is as follows : (The code works
perfectly fine for the Select * from Customers query)
public System.Data.DataSet execQueryDS(string Query)
{
DataAccess DataObj = new DataAccess();
OleDbConnection Cxn = DataObj.getConnection();
OleDbDataAdapter daGeneric = new OleDbDataAdapter(Query,Cxn);
System.Data.DataTable dtGeneric = new System.Data.DataTable();
System.Data.DataSet dsGeneric = new System.Data.DataSet();
daGeneric.Fill(dtGeneric);
dsGeneric.Tables.Add(dtGeneric);
return dsGeneric;
}
when it is a simple select statement like "Select * from Customers".
but when i try to do a simple search query like "SELECT * FROM Customers
WHERE LastName LIKE '*something*'", it does not return anything, even though
the same query returns records in the data base. Currently I am using MS
Access as the DB. The code for the function is as follows : (The code works
perfectly fine for the Select * from Customers query)
public System.Data.DataSet execQueryDS(string Query)
{
DataAccess DataObj = new DataAccess();
OleDbConnection Cxn = DataObj.getConnection();
OleDbDataAdapter daGeneric = new OleDbDataAdapter(Query,Cxn);
System.Data.DataTable dtGeneric = new System.Data.DataTable();
System.Data.DataSet dsGeneric = new System.Data.DataSet();
daGeneric.Fill(dtGeneric);
dsGeneric.Tables.Add(dtGeneric);
return dsGeneric;
}