winform下的datagridview绑定数据时怎么更改单元格的值
答案:2 悬赏:80 手机版
解决时间 2021-01-26 11:55
- 提问者网友:沦陷
- 2021-01-25 22:53
winform下的datagridview绑定数据时怎么更改单元格的值
最佳答案
- 五星知识达人网友:街头电车
- 2021-01-25 23:23
for example:
SqlConnection con = new SqlConnection( "server=.;database=student;uid=sa;pwd=0421 ");
SqlDataAdapter sda = new SqlDataAdapter( "select sno,sname,(case sex
when 1 then '男 ' when 2 then '女 ' end) as sex from studentDetails ",
con);
sda.Fill(ds, "student ");
//绑定
this.dataGridView1.DataSource=ds.Tables[ "student "];
SqlConnection con = new SqlConnection( "server=.;database=student;uid=sa;pwd=0421 ");
SqlDataAdapter sda = new SqlDataAdapter( "select sno,sname,(case sex
when 1 then '男 ' when 2 then '女 ' end) as sex from studentDetails ",
con);
sda.Fill(ds, "student ");
//绑定
this.dataGridView1.DataSource=ds.Tables[ "student "];
全部回答
- 1楼网友:不如潦草
- 2021-01-25 23:39
datagridview.rows[i].cells[j].value="hello";
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯