Hi ThundR,
You said: I know there is a thread that is sorta named the same but the solution provided is of no use to me. Do you mean this thread:
http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataproviders/thread/2367f061-4124-4050-8318-55193193c2d4?
In that thread, the answer provided the code snippet below:
partial class IPLDataSet
{
partial class CarRow
{
public bool validate()
{
if (CarId > 10)
{
SetColumnError("CarId", "Cannot be > 10");
RowError = "bugger!";
return false;
}
return true;
}
}
}
The code is in the .cs file. For example, if the typed dataset file is MyDBDataSet.xsd, the code is in file MyDBDataSet.cs, the automatically generated code is in file MyDBDataSet.Designer.cs.
IPLDataSet refers to the typed dataset name, in other words, the typed dataset class name. CarRow refers to the typed datarow class name. Validate is the added method to handle the data validating. In validate method, you can check the value of each property which is mapped to a column in a datarow. For example, if you need to restrict the value of CardId to less or equal than 10, you can check it and call SetColumnError and RowError to set the error. In conclusion, if we want to validate a custom DataRow, we only need to add a code snippet similar to above to the .cs file.
If the solution provided by the thread above cannot solve your issue, please let me know the reasons and your needs in detail, so that I can provide another solution for you.
Best regards,
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.