I am using an OleDbDataReader object to read the result from a search. The database is made with Access (it will be in SQLServer soon). <BR><BR>The Query is something like that :<BR><BR>SELECT * FROM Code WHERE AuthorName="Abc Def"<BR>(Normally Abc Def is an input from the user, but i've hardcoded something in my code, so i'm sure it's a good query)<BR><BR>With this query, my program is working. If i change the query for<BR><BR>SELECT * FROM Code WHERE AuthorName Like "*bc*"<BR><BR>it's not working in ASP.NET but if i just copy/paste the query in access, it's working. So is that normal that the OleDbDataReader thing can't read those results??You must come from an Access background.<BR><BR>With ODBC and OLE DB drivers, you must use % instead of * as the "match many" wild card.<BR><BR>And it's also _ vs. ? if you care.<BR><BR>ADO uses % for wildcards...Not the * that DAO uses in the Access environment.It looks like you've gotten over the vacation lag. <Grin />It's the first time i use access with asp.net... So that means it's not working with access or what? Because if i try with a '%' in my query, it's not working either.What do you mean it's not working? <BR><BR>That's too vauge.your real code here, so we can take a lookI don't use access.. It's almost the first time, but my query is not working with %. I looked in the access help and i saw the *, so i though maybe it was the problem.. But even if i use %, it's not working.No error. It's returning simply nothing.Here is a portion of my code :<BR><BR><BR>---------------------------------------------------------<BR>dbConn.connect()<BR><BR>dbConn.requete = "SELECT Code.IdCode, Code.Nom, Code.Code, Code.Description " & _<BR> "FROM Usager INNER JOIN Code ON Usager.IdAuteur = Code.IdAuteur " & _<BR> "WHERE Usager.Nom Like ""%e%"""<BR><BR>trace.Write(dbConn.requete)<BR><BR>objRequete = dbConn.execRequete()<BR><BR>objDataReader = objRequete.ExecuteReader(CommandBehavior.CloseConn ection)<BR><BR>While objDataReader.Read()<BR> trace.Write(objDataReader("Nom"))<BR>End While<BR><BR>dgAuteur.DataSource = objDataReader<BR>dgAuteur.DataBind() <BR><BR>objDataReader.Close()<BR>dbConn.disc<BR>---------------------------------------<BR><BR>I use a class that i've made and yes, i'm sure it's working because i'm using it elsewhere. Basicaly, it's just returning a dataReader with the results. (Requete = Query in english)<BR>dgAuteur is a datagrid. As you can see, i hard coded the query but normally it's from user inputs. If i execute that, i see nothing in the trace and the datagrid is empty. But if i execute that in access (replacing the % for a *), it's returning me 10 rows.Usager.Nom Like ""%e%""" <BR><BR>Should be:<BR><BR>Usager.Nom Like '%e%'"<BR><BR>If you're looking for *every* record that contains e in that field.With access it's ".. But i found my problem and it's probably the "vacantion lag" like the other one said. Sorry
<BR>And thanx for your time. <BR><BR>I just didn't realized that results were apearing in the trace table, and since i was iterating trough records to show them and AFTER that i was filling the datagrid, well, the datagrid was still empty.And BTW...the "vaction lag" comment was directed at Bill, not you, 'cause he was slow yesterday, after coming back from holiday, but he beat me this time.Oh ok.. But since i'm going in vacantion soon, (friday), well my brain is beginning to lag a little !
