ashima kukreja

ashima kukreja

  • NA
  • 19
  • 14.1k

asp.net

May 28 2013 4:41 AM
hello,

       i have a field in my table isadmin where if he is admin it is 1 otherwise it is set to 0.
on a page load i want to show my gridview  so i am wiritting   this code .


SqlCommand cmd = new SqlCommand(" select fname,lname from UserInfo where IsAdmin=@IsAdmin" , cn);
                    cmd.Parameters.Add(new SqlParameter("@IsAdmin" i want here  that isadmin should take 0 so that it will display rows what to write here ));

                    SqlDataAdapter da = new SqlDataAdapter(cmd);
                    DataSet ds = new DataSet();
                    da.Fill(ds);
                    GridView1.DataSource = ds;
                    GridView1.DataBind();

Answers (2)