Hi Eva,
I see what you mean now.
if you now the row number from the datatable it is also easy
Everything again roughly here written, so you do know very good testing, I
think it is right but I never know for sure
\\\\
dim ClientInsRow as datarow
If .....this row has not already been inserted do the following....
ClientInsRow = dsFullBooking.Tables("dtClient").NewRow()
dsFullBooking.Tables("dtClient").Rows.Add(ClientIn sRow)
////
..........if you are using primary keys than add them here and not again in
the rows below
\\\
else
dim ClientInsRow as datarow =
dsfullbooking.tables.tables("dtClient").rows(myrow number)
end if
ClientInsRow("Surname") = txtSurname.Text
ClientInsRow("Forename") = txtForename.Text
ClientInsRow("OrgName") = txtOrganisation.Text
ClientInsRow("Address") = txtAddress.Text
ClientInsRow("Postcode") = txtPostcode.Text
///
When you not want to use the primary key you can do something as this if you
do not know the rownumber
\\\
dim myrownumber as integer
for myrownumber = 0 to
ds.dsfullbooking.tables.tables("dtClient").rows.co unt-1
if dsfullbooking.tables.tables("dtClient").rows(myrow number)("Forename")
= txtForename.Text andalso xxxxx = txtSurname.Text.
exit for
next
////
However if you use a primary key you can simple do by instance
\\\
Dim findTheseVals(1) As Object
findTheseVals(0) = txtForename.Text
findTheseVals(1) = txtSurname.Text
ClientInsRow =
dsfullbooking.tables.tables("dtClient").rows.find( findTheseVals)
////
I hope it will go all
Cor
this is what i have done so far....
If .....this row has not already been inserted do the
following.... Dim ClientInsRow As DataRow =
dsFullBooking.Tables("dtClient").NewRow() ClientInsRow("Surname") = txtSurname.Text
ClientInsRow("Forename") = txtForename.Text
ClientInsRow("OrgName") = txtOrganisation.Text
ClientInsRow("Address") = txtAddress.Text
ClientInsRow("Postcode") = txtPostcode.Text
ClientInsRow("PhoneNo") = txtPhoneNo.Text
dsFullBooking.Tables("dtClient").Rows.Add(ClientIn sRow)
Else : if the row has already been inserted, right over the
existing row.
End If
this is the code have placed in the onclick_event for my OK button.
what i am stuck on what to right on the first 'if' line and in the 'else'
part fo the code. I have placed in pseudo code so that u can see what i am
trying to achieve.