G
Guest
my problem is duplicating records
for example i have this records in dataset first
name stundentno
----------------------- -------------------------
SAM 1
GEORGE 2
AFTER ADDING A NEW RECORD
name stundentno
----------------------- -------------------------
NICHOLAS 3
then i saw in datagrid like this
name stundentno
------------- ---------- -------------------------
SAM 1
GEORGE 2
SAM 1
GEORGE 2
NICHOLAS 3
stok.name = txtname.Text
stok.stundentno = txtstundentno.Text
Private Sub btnEkle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEkle.Click
'adding
stok.MinNoGecici()
stok.con.Open()
stok.MinNoGeciciSqlInsertCMD.ExecuteNonQuery()
stok.con.Close()
stok.MinNoGecici()
stok.MinNoGeciciDA.Fill(stok.MinNoGeciciDS, "MinNoGecici")
DataGrid1.DataSource = stok.MinNoGeciciDS
DataGrid1.DataMember = "MinNoGecici"
DataGrid1.Refresh()
btnEkle.Enabled = False
end sub
for example i have this records in dataset first
name stundentno
----------------------- -------------------------
SAM 1
GEORGE 2
AFTER ADDING A NEW RECORD
name stundentno
----------------------- -------------------------
NICHOLAS 3
then i saw in datagrid like this
name stundentno
------------- ---------- -------------------------
SAM 1
GEORGE 2
SAM 1
GEORGE 2
NICHOLAS 3
stok.name = txtname.Text
stok.stundentno = txtstundentno.Text
Private Sub btnEkle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEkle.Click
'adding
stok.MinNoGecici()
stok.con.Open()
stok.MinNoGeciciSqlInsertCMD.ExecuteNonQuery()
stok.con.Close()
stok.MinNoGecici()
stok.MinNoGeciciDA.Fill(stok.MinNoGeciciDS, "MinNoGecici")
DataGrid1.DataSource = stok.MinNoGeciciDS
DataGrid1.DataMember = "MinNoGecici"
DataGrid1.Refresh()
btnEkle.Enabled = False
end sub