新手上路~今天做一个简单的登陆验证  如下
  string name = textBox1.Text;
            string password = textBox2.Text;            string connstr = @"Persist Security Info=False;User ID=sa;password=sa;Initial Catalog=mycomputer;Data Source=PC-05280902";
            SqlConnection conn = new SqlConnection();
            conn.ConnectionString = connstr;
                       string commstr = @"select * from login  where name='" + textBox1.Text + "' and password='" + textBox2.Text+"' ";
            SqlCommand comm = new SqlCommand();
            comm.CommandText = commstr;
            comm.Connection = conn;            SqlDataAdapter da=new SqlDataAdapter();
            da.SelectCommand=comm;
            conn.Open();
            DataSet ds = new DataSet();
            da.Fill(ds);
            int f = comm.ExecuteNonQuery();            if (f > 0)
                MessageBox.Show("ok");
            else 
                MessageBox.Show("no");
可是不管我输入正确or错误的信息都会弹出“no”
大侠们指点指点