I created a dataset with a datatable. I have a textbox and on click event of a button I add the text of the textbox as a new row to the datatable. However everytime I add a new row, the datatable seems to lose the previous entered data.
Why is this happening and is there a way to keep adding data to the datatable without losing the previously entered data?
Dim myDS As DataSet = New DataSet("myDS")
Dim myDT As DataTable = myDS.Tables.Add("MyTable")
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
myDT.Columns.Add("TestColumn", Type.GetType("System.String"))
GridView1.DataSource = myDT
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dr As DataRow
dr = myDT.NewRow()
dr(&q ...
Go to the complete details ...