B
Betina Andersen
I have a componentOne grid along with an SqlDataSource on my aspx page, now
I want to add a new row to my grid and tries to do this:
Dim ds As DataSet = Page.Session("MyDataset")
Dim dt As New DataTable
Dim dr As DataRow
dr = dt.NewRow()
dr.ItemArray = dt.Rows(0).ItemArray
dr.Item("Fag") = System.DBNull.Value
dr.Item("Tekst") = System.DBNull.Value
dt.Rows.Add(dr)
dt.AcceptChanges()
wgFag.DataSource = dt
wgFag.DataBind()
But I get an error in this line
dr = dt.NewRow()
and when looking my ds is Nothing - so how do I get the dataset from my
datasource into my ds variable?
Thanks
Betina
I want to add a new row to my grid and tries to do this:
Dim ds As DataSet = Page.Session("MyDataset")
Dim dt As New DataTable
Dim dr As DataRow
dr = dt.NewRow()
dr.ItemArray = dt.Rows(0).ItemArray
dr.Item("Fag") = System.DBNull.Value
dr.Item("Tekst") = System.DBNull.Value
dt.Rows.Add(dr)
dt.AcceptChanges()
wgFag.DataSource = dt
wgFag.DataBind()
But I get an error in this line
dr = dt.NewRow()
and when looking my ds is Nothing - so how do I get the dataset from my
datasource into my ds variable?
Thanks
Betina