dr is field used as a method

Sep 22 2008 2:37 AM

hi folks can anyone help me
dr is field used as a method

con.Open();
            cmd = new SqlCommand("select count(*) from tblUsers where UserId='" + txtUserName.Text + "'", con);
            dr = cmd.ExecuteReader();
            int count;
            if ((dr.Read()))
            {
                count = (dr(0));
//Here im getting an error
            }
            con.Close();

            if (count > 0)
            {
               
            }
            else
            {
               }


Answers (2)