Error with "merge" or "select" [RESOLVED]
Hi
I have a datagrid with that is bound to a dataset(dsFiltered) and a second dataset that contains all my records.
What I want to do is when you type in a word in a textbox(txtsearch) and click a button the dsfiltered dataset must be filled with a "filtered" version of dsALL
The databinding is as follows
And the code that runs whenI press the button is:
This works fine the first time I run the code but when I click the button a second time I get the following ERROR :
An Unhandled exception of type 'System.Data.RowNotInTableException' occurred in system.windows.forms.dll
Additional Information:This row has been removed from a table and does not have any data. BeginEdit() will allow creation of new data in this row.
Hi
I have a datagrid with that is bound to a dataset(dsFiltered) and a second dataset that contains all my records.
What I want to do is when you type in a word in a textbox(txtsearch) and click a button the dsfiltered dataset must be filled with a "filtered" version of dsALL
The databinding is as follows
VB.NET:
dgAll.DataSource = dsFiltered
dgAll.DataMember = dsFiltered.Extend.TableName.ToString
And the code that runs whenI press the button is:
VB.NET:
Try
dsFiltered.Extend.Clear()
dsFiltered.Merge(dsAll.Extend.Select("fullname like '%" & txtSearch.Text & "%'"))
Catch ex As Exception
MsgBox(ex.Message)
End Try
This works fine the first time I run the code but when I click the button a second time I get the following ERROR :
An Unhandled exception of type 'System.Data.RowNotInTableException' occurred in system.windows.forms.dll
Additional Information:This row has been removed from a table and does not have any data. BeginEdit() will allow creation of new data in this row.
Last edited: