c#使用dataset时,datagridview中没有显示出数据

shijixinmei888 shijixinmei888 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
: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);
望高手指点,感激不尽!
...全文
评论 4
收藏 已收藏
分享
返回顶部
shijixinmei888
C# 111,128 成员 642,536 内容