PlausiblyDamp
Administrator
AcceptOrReject isn't being called from anywhere in the code you posted, did you mean to call it from somewhere or did you not post the code that does call it?
private void btnNropslaan_Click(object sender, EventArgs e)
{
if (dsLogging.Tables["roepnummers"].Rows.Count == 0)
{
foreach (string nummer in rtbRoepnummers.Lines)
{
DataRow drRoepnr = dsLogging.Tables["roepnummers"].NewRow();
drRoepnr["nummer"] += nummer;
dsLogging.Tables["roepnummers"].Rows.Add(drRoepnr["nummer"]);
lbroepnrnieuwbericht2.Items.Add(drRoepnr[0]);
ClbRoepnr.Items.Add(drRoepnr[0]);
}
}
else
{
foreach (string nummer in rtbRoepnummers.Lines)
{
foreach (DataRow drRoepnrc in dsLogging.Tables["roepnummers"].Rows)
{
if (drRoepnrc["nummer"].ToString() != nummer)
{
DataRow drRoepnr = dsLogging.Tables["roepnummers"].NewRow();
drRoepnr["nummer"] += nummer;
dsLogging.Tables["roepnummers"].Rows.Add(drRoepnr["nummer"]);
lbroepnrnieuwbericht2.Items.Add(drRoepnr[0]);
ClbRoepnr.Items.Add(drRoepnr[0]);
}
break;
}
}
}
MessageBox.Show("Roepnummer is toegevoegd!", "Toegevoegd!");
}
[B]Example:[/B]
A list of numbers in the dataset...
1
2
In the RichTextBox the folowing numbers are shown:
1
2
I update the list to this:
1
2
3
4
5
The result in the dataset will be:
1
2
2
3
4
5
I add the folowing numbers:
6
7
Result:
1
2
2
3
4
5
2
3
4
5
6
7