MS ACCESS query

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hi all -

I got a pretty basic question that's been bugging me today. I'm using
ASP.NET, C# and MS Access for a database driven application. I have a
datagrid that will populate based on a registered user's access level.
There are some instances where I'd like to use a basic OR statement in my
Access query, but I do not know the syntax. The statement I'd like to use
is below

cmd = new OleDbCommand("Select * FROM
"+Session["ClassroomSession"].ToString()+"WHERE AccessLevel=\"All\" OR
AccessLevel=\"Speaker\" ORDER BY ID", conn);

In this case, I'd like to populate the datagrid with all elements WHERE the
field "AccessLevel" is EITHER "All" OR "Speaker".

Please help!

Thanks in advance.

Dave Harrington


.



Relevant Pages

  • Re: MS ACCESS query
    ... ¤ Hi all - ... I got a pretty basic question that's been bugging me today. ... datagrid that will populate based on a registered user's access level. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Newbie object design questions
    ... Chip - you can use a Reader to populate your business objects, ... If you use a DataTable/DataSet you can also bind your grid to this and with ... > objects in some form of collection that could be placed into a DataGrid. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Object does not match target type.
    ... residing in the directory named "Folder1". ... In order to populate the DataGrid ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Data Access in web forms
    ... >> want to populate those from the database. ... >> but nothing gets populated in the text boxes. ... >> Is there any sample where it shows/teaches data access without a datagrid ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Populate a datagrid in vb6 with values from a .dbf file
    ... If you are using bound datagrid, then you cannot populate grid using your ... but would need to bind your recordset to this grid. ... What you could do is to use MSFlexGrid control or some other third-party ...
    (microsoft.public.data.ado)