ljhodgett
asked on
Create dataset programatically in vb.net 2005
Hi,
I'm trying to find out how to create a dataset and table programatically.
Basically I need a table that will store textbox1.text in column 1 and textbox2.text in column 2
How do I do this please?
Many thanks
Lee
I'm trying to find out how to create a dataset and table programatically.
Basically I need a table that will store textbox1.text in column 1 and textbox2.text in column 2
How do I do this please?
Many thanks
Lee
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dim ds As New DataSet
Dim dt As New DataTable("table1")
dt.Columns.Add("Column1", GetType(String))
dt.Columns.Add("Column2", GetType(String))
Dim row As DataRow = dt.NewRow
row("Column1") = TextBox1.Text
row("Column2") = TextBox2.Text
dt.Rows.Add(row)
ds.Tables.Add(dt)