datagridview要注意的事(1)

mac2022-06-30  88

1 DataSet ds = new DataSet(); 2 SqlDataAdapter sqlda = new SqlDataAdapter("select workername as 用户名,compensation.workerid as 名字id ,compensationtime as 发薪时间,addworkcompensation as 加薪,losecompensation as 扣薪,othercompensation as 其他薪资 from compensation join worker on compensation.Workerid = Worker.Workerid where compensation.workerid=22", da.link()); 3 sqlda.Fill(ds, "table1"); 4 compensationBindingSource.DataSource = ds.Tables["table1"];

这个表原来被绑定过,当我更换绑定的数据源的时候就这样了,当我把SQL语句中的as取消的时候,就好了

1 DataSet ds = new DataSet(); 2 SqlDataAdapter sqlda = new SqlDataAdapter("select workername,compensation.workerid ,compensationtime,addworkcompensation ,losecompensation ,othercompensation from compensation join worker on compensation.Workerid = Worker.Workerid where compensation.workerid=22", da.link()); 3 sqlda.Fill(ds, "table1"); 4 compensationBindingSource.DataSource = ds.Tables["table1"];

<img></img>

转载于:https://www.cnblogs.com/dingyikai/archive/2012/12/10/2811774.html

最新回复(0)