DataGridView显示重复(双精度)值 [英] DataGridView shows duplicate (Double) values
本文介绍了DataGridView显示重复(双精度)值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的所有人,
我编写了代码,以在DataGridView中显示一些数据.但它显示重复的值.这是代码,
Dear All,
I have written a code to display some data in a DataGridView. but it shows duplicate values. here is the code,
public void showEvents()
{
cmd2 = new MySqlCommand();
String cmdString2 = "SELECT d.DId, d.Date,d.Time,d.Temp, d.DLane, d.DVentilation, d.DRemarks FROM date d, container c, Plugoff p where c.GKId=d.GKId AND c.ContainerNo like ('" + txtContNo.Text + "%') AND c.GKId = ('" + txtUsed.Text + "') ";
adp = new MySqlDataAdapter(cmdString2, con);
ds = new DataSet();
adp.Fill(ds, "cont");
dataGridView1.DataSource = ds.Tables["cont"];
}
请尽快告诉我这个问题???
please someone show me the issue soon ???
推荐答案
您正在联接三个表,但是where子句仅包含它们之间的一个联接.
从查询中删除Plugoff p
,然后重试.我不认为您会在任何地方使用它的任何值.
You are joining three tables but you where clause contains only one join between them.
RemovePlugoff p
from your query and try again. I don''t think you are using any values from it anywhere as it is anyway.
这篇关于DataGridView显示重复(双精度)值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文