:c#使用dataset时,datagridview中没有显示出数据,但是点击它时数据却有显示在后面的文本框中
MySqlConnection myconn = new MySqlConnection();
myconn.ConnectionString = "server=localhost;user id=root;password=;database=xsgl";
MySqlCommand mycomm = new MySqlCommand();
mycomm.Connection = myconn;
mycomm.CommandType = CommandType.Text;
mycomm.CommandText = "select * from score";
MySqlDataAdapter = new MySqlDataAdapter();
MySqlDataAdapter.SelectCommand = mycomm;
MySqlCommandBuilder builder = new MySqlCommandBuilder(MySqlDataAdapter);
dsscore = new DataSet();
MySqlDataAdapter.Fill(dsscore, "score");
this.BindingContext[dsscore, "score"].PositionChanged += new EventHandler(BindingManagerBase_Positionchanged);
textBox1.DataBindings.Add(new Binding("text",dsscore,"score.studid"));
textBox2.DataBindings.Add(new Binding("text", dsscore, "score.courseid"));
textBox3.DataBindings.Add(new Binding("text", dsscore, "score.score"));
dataGridView1.DataSource = dsscore;
dataGridView1.DataMember = "score";
Showposition();
setstate(true);
望高手指点,感激不尽!