How correclty use Gl.glGenQueriesARB ?
I'm using Tao form my small project and I encounter some problem. When I'm trying to make some queries I've got some strange errors...
for example :
IntPtr queryNumber = IntPtr.Zero;
Gl.glGenQueriesARB(1,queryNumber);
Gl.glBeginQueryARB(Gl.GL_SAMPLES_PASSED_ARB,queryNumber.ToInt32());
Gl.glBindTexture(Gl.GL_TEXTURE_2D, im.get("kitty.png"));
Gl.glBegin(Gl.GL_QUADS);
Gl.glTexCoord2f(0, 1); Gl.glVertex2f(-25, 0);
Gl.glTexCoord2f(1, 1); Gl.glVertex2f(25, 0);
Gl.glTexCoord2f(1, 0); Gl.glVertex2f(25, -50);
Gl.glTexCoord2f(0, 0); Gl.glVertex2f(-25, -50);
Gl.glEnd();
Gl.glEndQueryARB(Gl.GL_SAMPLES_PASSED_ARB);
Gl.glGetQueryObjectuivARB(queryNumber.ToInt32(), Gl.GL_QUERY_RESULT_ARB, fragmentCount);
this how I try to do this but I have error in 3 line:
Gl.glGenQueriesARB(1,queryNumber); <-
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
So I'm little confused... Some advice?

What is the version number
What is the version number of Tao.OpenGl? If you haven't done so already, try updating to 2.1.0.12, found here.
Edit: Also, try to call Gl.ReloadFunctions() just before the failing call. It might be that extension loading has failed, because it happened before the OpenGL context was available.
------
OpenTK
Edit: Also, try to call
Edit: Also, try to call Gl.ReloadFunctions() just before the failing call.
Thanks
Now it's working fine 
Note that ReloadFunctions()
Note that ReloadFunctions() is a costly call (first call: 100-300 ms, then 10-50 ms per call, depending on the platform). Just call it once after creating the window with the opengl context
------
OpenTK