locked
query RRS feed

  • Question

  • User1382482195 posted

    i have a website and put this query to show a button when idfunction=1 to check idfunction it have to get iduserand now i want to show when idfunction is 1 and 2 but still need to get iduser to get id function but with my query itshows when idfunction is 1,2,3,4, and want only 1 and 2


                ArrayList _arraySqlParams = new ArrayList();

                _arraySqlParams.Add(new OleDbParameter("Username", idUser));


                int c = (Convert.ToInt32(OleDbHelper.executeScalar("SELECT ID, IDFuncao FROM Utilizador WHERE (((Utilizador.ID)=[?]) AND (Utilizador.IDFuncao)=1 AND (Utilizador.IDFuncao)=2)", (OleDbParameter[])_arraySqlParams.ToArray(typeof(OleDbParameter)))));
             
              return c;

    Tuesday, March 29, 2011 9:25 AM

All replies

  • User3866881 posted

    Some questions should be clarified first:

    1)How did you write your executeScaler method? Maybe you should let us have a look at it:)

    2)By the way, since your sql statement has only a parameter that has the token symbol "?", how can you pass an array there?

    Thx

    Thursday, March 31, 2011 10:09 PM