A
artur_mis
I have got tables:
ptyp(child table, id primary):
+----+---------+--------+---------+
| id | name | length | density |
+----+---------+--------+---------+
| 1 | kwidzyn | 780 | 45 |
| 2 | kwidzyn | 1170 | 45 |
| 3 | myszkow | 780 | 45 |
+----+---------+--------+---------+
zpaper(main table,id primary key, typ foregin key):
+------------+---------+-------+----+------+
| data | stan | ilosc | id | typ |
+------------+---------+-------+----+------+
| 2008-11-12 | dostawa | 3 | 1 | 2 |
| 2008-11-12 | zwrot | 3 | 2 | 1 |
| 2007-09-09 | dostawa | 4 | 3 | 2 |
+------------+---------+-------+----+------+
the tables are connected via key zpaper.typ and ptyp.id.
DGV consist of ( ptyp.data, p.typ.stan, ptyp.ilosc,
zpaper.typ(datagridcomboboxcolumn) )
In cloumn of DGV zpaper.typ i would like have only not duplicated
values from zpaper.stan.
The part f code looks like this :
DataGridViewComboBoxColumn cbcol2 = new
DataGridViewComboBoxColumn();
cbcol2.HeaderText = "Dostawca";
cbcol2.DataPropertyName = "typ"; //pierwsza tabela wezel.
cbcol2.DisplayMember = "name";//to co wyswietlamy z drugiej
tabeli.
cbcol2.ValueMember = "id"; // druga tabela wezel.
cbcol2.DataSource = bs2
DGV.Columns.Add(cbcol2);
Other colums are binded to bs1.
where:
bs1.DataSource = ds.Tables["zpapier"];
bs2.DataSource = ds.Tables["ptyp"];
The result i have is duplicated entry for string "kwidzyn".Is it way
to change this situation to behavior:
- one string kwidzyn (now i have double).
- when i set kwidzyn in combo in other column (for example combo)
will occure all length 780 and 1170 ?
- do i need to change data base ?
Regards.
Beginer in csh.
ptyp(child table, id primary):
+----+---------+--------+---------+
| id | name | length | density |
+----+---------+--------+---------+
| 1 | kwidzyn | 780 | 45 |
| 2 | kwidzyn | 1170 | 45 |
| 3 | myszkow | 780 | 45 |
+----+---------+--------+---------+
zpaper(main table,id primary key, typ foregin key):
+------------+---------+-------+----+------+
| data | stan | ilosc | id | typ |
+------------+---------+-------+----+------+
| 2008-11-12 | dostawa | 3 | 1 | 2 |
| 2008-11-12 | zwrot | 3 | 2 | 1 |
| 2007-09-09 | dostawa | 4 | 3 | 2 |
+------------+---------+-------+----+------+
the tables are connected via key zpaper.typ and ptyp.id.
DGV consist of ( ptyp.data, p.typ.stan, ptyp.ilosc,
zpaper.typ(datagridcomboboxcolumn) )
In cloumn of DGV zpaper.typ i would like have only not duplicated
values from zpaper.stan.
The part f code looks like this :
DataGridViewComboBoxColumn cbcol2 = new
DataGridViewComboBoxColumn();
cbcol2.HeaderText = "Dostawca";
cbcol2.DataPropertyName = "typ"; //pierwsza tabela wezel.
cbcol2.DisplayMember = "name";//to co wyswietlamy z drugiej
tabeli.
cbcol2.ValueMember = "id"; // druga tabela wezel.
cbcol2.DataSource = bs2
DGV.Columns.Add(cbcol2);
Other colums are binded to bs1.
where:
bs1.DataSource = ds.Tables["zpapier"];
bs2.DataSource = ds.Tables["ptyp"];
The result i have is duplicated entry for string "kwidzyn".Is it way
to change this situation to behavior:
- one string kwidzyn (now i have double).
- when i set kwidzyn in combo in other column (for example combo)
will occure all length 780 and 1170 ?
- do i need to change data base ?
Regards.
Beginer in csh.