I have a dataset that I created programmatically and bind to a datagrid.
When I add a row and I .show the form I get an error "Error creating window
handle"
This only happens if I have the code to add the row active. If I comment it
out then the form loads successfully (without any records, obviously).
Below is the code:
'-----------------------------Code Starts
Here----------------------------------
Dim dsCategories As New DataSet
Dim tbl_Categories As New DataTable
tbl_Categories.Columns.Add("CatNumber",
System.Type.GetType("System.String"))
tbl_Categories.Columns.Add("CatName",
System.Type.GetType("System.String"))
tbl_Categories.Columns.Add("CatCode",
System.Type.GetType("System.String"))
Dim drCurRow As DataRow = dsCategories.Tables("tbl_Categories").NewRow
drCurRow("CatNumber") = "1"
drCurRow("CatName") = "Regular"
drCurRow("CatCode") = "110"
dsCategories.Tables("tbl_Categories").Rows.Add(drC urRow)
grdCategories.DataSource = dsCategories
'---------------------------------Code Ends
Here--------------------------------
I Hope this is the right newsgroup to post this.
--
Thank you for your help