I have a C# Windows forms application which uses XSD file created in memory dataset. On one of the forms I have bunch of text boxes to enter values for various columns of a table and they all are data bound. For one of text boxes value entered must be unique and I want to check this uniqueness as soon as user leaves corresponding text box after entering any value.
I have tried following two methods and none seems to be working
1. If I try to attach a UniqueConstraint on corresponding column then it will not get fired until acceptchanges is not called and thus I cannot validate value as soon as user leaves field.
2. If I try to get a DataView with a rowfilter based upon value entered by user then it does not looks into rows which have â??modifiedâ?? or â??addedâ?? row state. I have tried to use all possible combination of DataViewRowState enumeration values but nothing seems to be able to force returned DataView to include modified or added status rows. Thus I get duplicate values in table
So I have two questions â??
1. Is it possible to enforce UniqueConstraint before AcceptChanges is called on Row / Table (may be in column changing event itself)?
2. What can cause an DataView to skip â??modifiedâ?? or â??addedâ?? row state rows even if DataViewRowState. CurrentRows has been specified for RowViewState of DataView?
My apologies for possibly a vague explanation of my problem and thanks in advance for any thoughts.
KT
---
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.