Hi,
I am trying to add NewRow to the database by using datatable in dataset, but before I do that I want to make sure that row is not already there. I create new row for the datatable I am working with, fill it with information. I fill datatable with the row from database that has the same primary key as my NewRow by using tableadapter.fi ll method, but when I do that my NewRow that was never added to the datatable is filled with information from database(and not information that I assigned to it). I count rows in my datatable before I fill it and it's 0, so why is my NewRow affected by Fill command? (I am using VB.NET 2005 Framework 2.0)
This is my first post so I hope I was clear enough.
Thank you in advance.
I am trying to add NewRow to the database by using datatable in dataset, but before I do that I want to make sure that row is not already there. I create new row for the datatable I am working with, fill it with information. I fill datatable with the row from database that has the same primary key as my NewRow by using tableadapter.fi ll method, but when I do that my NewRow that was never added to the datatable is filled with information from database(and not information that I assigned to it). I count rows in my datatable before I fill it and it's 0, so why is my NewRow affected by Fill command? (I am using VB.NET 2005 Framework 2.0)
This is my first post so I hope I was clear enough.
Thank you in advance.
Code:
Dim newRow As dsMain.TF_INFORow newRow = Me.DsMain1.TF_INFO.NewTF_INFORow newRow.Owner_Name="bla" Me.TaTF_INFO1.FillByVehicle(Me.DsMain1.TF_INFO) 'newRow is lost - "bla" is not there
Comment