Hi Jim,
Based on my understanding, you want to do the row filter through dataview
for your datatable.
After view your code, I find that your filter is correct, but you get the
filtered rows in an in-correct way.
After setting the RowFilter for DataView, you use DataView.Table property
to get the rows. If you view in MSDN, you will see that DataView.Table
property gets the source DataTable, which has nothing to do with filter(You
only filter the dataview not the underlying datatable). So you will get the
source datatable's first row.
Actually, you should do like this:
DataView dv_filter=new DataView();
dv_filter.Table=ds.Tables[0];
dv_filter.RowFilter ="Emplcode = '123233'";
MessageBox.Show(dv_filter[0].Row["Emplcode"]);
================================
Please apply my suggestion above and let me know if it helps resolve your
problem.
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.