4
votes
9answers
2k views

Writing an IsDate() equivalent in C#?

Apologies if this has been asked before. I have some data which I need to store as strings, some of that data being dates. The data starts off as strings like "01/02/10" (uk format). Now, later on, ...
3
votes
4answers
63 views

How to make use of Try and Catch for setting values

How I can get a try catch inside Letter to invoke a try catch inside Program? At the moment I am using a bool as a validator but I want any false bool to throw a error and for Program to see this. ...
1
vote
4answers
75 views

How to validate a .csv file before storage in C#?

I have some .csv files which I am parsing before storing in database. I would like to make application more robust, and perform validation upon the .csv files before save in the database. So I am ...
8
votes
3answers
31k views

Best way to check if a Data Table has a null value in it

what is the best way to check if a Data Table has a null value in it ? Most of the time in our scenario, one column will have all null values. (This datatable is returned by a 3rd party application ...
0
votes
5answers
3k views

Validate float number using RegEx in C#

I am trying to make a Numeric only TextBox in WPF and I have this code for it: void NumericTextBox_PreviewTextInput(object sender, TextCompositionEventArgs e) { e.Handled = !IsValidInput(e.Text); ...
0
votes
1answer
30 views

Event to take control's text via event args

What is the event I should subscribe to in order to get TextBox's Text in the event args? I've tried PreviewTextInput, but if input string is, for example, "122." the box's (see code) text is without ...
0
votes
1answer
20 views

Disable ValidatesOnDataErrors if CheckBox is Checked WPF

I am trying to disable ValidatesOnDataErrors on a TextBox if a certain checkbox is checked. I have tried placing a trigger on textbox to enable or disable validation based on the checkbox seems like ...
2
votes
3answers
47 views

Regex to match decimal value

I have the following regex to match decimals: @"[\d]{1,4}([.][\d]{1,2})?" but I am able to input multiple decimal dots. How can I prevent this? In general, I can have input strings like "2000" or ...
1
vote
5answers
39 views

asp:RequiredFieldValidator validation based on conditions

I have validation as below but only like to triggered if the checkbox is ticked. <!-- TextBox and its validator --> Name: <asp:TextBox ID="TextBox1" runat="server" /> ...
0
votes
2answers
40 views

How to make separated validation in WPF Application in Windows application

I want to make validation in a separated xaml definition with my own custom code in C# to make windows form. I have been read the resource about code like this validation with custom validation ...
0
votes
0answers
29 views

Display of dynamically added ASP.NET is not updated on validation

I creating a dynamic compare validated as in the tutorial found on here. Unfortunely, the article leaves off adding the element to the page (which I have). However, I have validated the validation ...
0
votes
1answer
1k views

Regex Full Date validation

NOTE THIS IS NOT A QUESTION ABOUT WHAT IS THE BEST WAY WITH CODE TO DO DATE VALIDATION THIS IS A QUESTION ABOUT LEARNING MORE ABOUT REGULAR EXPRESSIONS THROUGH SOME TRIAL AND ERROR AND OTHER PEOPLES ...
0
votes
1answer
32 views

Prevent html tags entries in mvc textbox using regular expression

I want to prevent any html tags (written between "<>") in a textbox in my mvc 4 application. I have given the data annotation regular expression for my property as follows: ...
2
votes
1answer
43 views

Adding validation in WinForms without IDataErrorInfo

I'm working on an (legacy) WinForms application and I like to do a more dynamic way of supplying the users with error information in a way I'm used to do with MVC. Validation in WinForms however ...
-1
votes
0answers
12 views

Address Validator using map in SharePoint 2010

In any form with Address field in SP 2010,add a menu item or button which will validate the address field and also show a pop up map to locate the address.Mean like required field validator I want to ...

1 2 3 4 5 118
15 30 50 per page