[求助]数据统计问题!
如上图,红色部分是我想实现的效果,
数据层:
public DataSet EquipAll()
{
try
{
string sql = "select s.id as 编号,p.XZ_Name as 所属派出所,s.bus as 汽车,s.bike as 自行车,s.computer as 计算机,s.saomiaoyi as 扫描仪 from equip as s,paicusu_table as p where p.id=s.paicusu_id";
SqlDataAdapter da = new SqlDataAdapter(sql, con);
da.Fill(ds, "equip");
}
catch (Exception ex)
{
throw ex;
}
return ds;
}
表示层:
this.dataGridView1.DataSource = ds.Tables["equip"].DefaultView;
ds.Tables["equip"].DefaultView.AllowNew = false;//去掉空行
请帮我修改一下要如何实现这种效果,急,谢谢!!