Should I have to explicity create a dataset even it is already defined in design time?
-
Hello, I am working with a dataset and I just realized that there is a few methods in vb.net to add a new row to a dataset. Can I simply add a row in figure 1 instead of creating an explicit dataset and a data table because in design time I created a dataset already. Why do I have to explicitly create a dataset and a table and then a row if I am able to add a new row with new values with a single line code? Thanks.
Figure 1. // I have assumed 3 columns in the NameTable
BPRO.NameTable.Rows.Add("Jashua", "Carla", "Chris")
THE USUAL WAY WAS
Figure 2.
Dim NewDS As New BPRO Dim Rt As New BPRO.NameTable Dim NewRow As DataRow = NewDS.Tables("NameTable").NewRow NewRow("Names") = Trim(UserName.Text.ToUpper) NewDS.Tables("NameTable").Rows.Add(NewRow)
What a curious mind needs to discover knowledge is noting else than a pin-hole.
-
Hello, I am working with a dataset and I just realized that there is a few methods in vb.net to add a new row to a dataset. Can I simply add a row in figure 1 instead of creating an explicit dataset and a data table because in design time I created a dataset already. Why do I have to explicitly create a dataset and a table and then a row if I am able to add a new row with new values with a single line code? Thanks.
Figure 1. // I have assumed 3 columns in the NameTable
BPRO.NameTable.Rows.Add("Jashua", "Carla", "Chris")
THE USUAL WAY WAS
Figure 2.
Dim NewDS As New BPRO Dim Rt As New BPRO.NameTable Dim NewRow As DataRow = NewDS.Tables("NameTable").NewRow NewRow("Names") = Trim(UserName.Text.ToUpper) NewDS.Tables("NameTable").Rows.Add(NewRow)
What a curious mind needs to discover knowledge is noting else than a pin-hole.